|
is it a problem if contain too much label will make the system lagging?
i have 400 label actually cause i doing a game want to move the token at specific direction. And i using 3 timer also on dice and movement.
if tis the reason make the system run slow?
|
|
|
|
|
Your question doesn't make any sense, but...
If you're moving 400 labels around or are waiting for 400 labels to paint themselves, you'll be waiting a long time. So, yes, it's possible that this is what's causing your app to lag.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
actually the label were fix in the location whic i dont move it.
but i will move the image to the according label, like when i want to move it to label1 or label 100.
u think that cause lag also?
|
|
|
|
|
Without seeing or knowing anything of your code, it's impossible to say what's lagging...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Here is it, first i create 400 label for each player to move to it own position, the checkplayerpos() is i set the position where i locate it in my design form there, the timer2() is where i use timer to move around the token one by one according to their dice value from 1-6
------------------
Public Sub checkplayerpos()
If PTurn.Text = 1 Then
z = 1000
ElseIf PTurn.Text = 2 Then
z = 2000
ElseIf PTurn.Text = 3 Then
z = 3000
ElseIf PTurn.Text = 4 Then
z = 4000
End If
End Sub
------------------------------
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
'Control array
Dim squarelabel As Label() = ControlArrayUtils.getControlArray(Me, "Label")
Dim PlayerP As PictureBox() = ControlArrayUtils.getControlArray(Me, "Player")
Dim Ppos As Label() = ControlArrayUtils.getControlArray(Me, "PP")
Dim com As Label() = ControlArrayUtils.getControlArray(Me, "com")
'Get the value whos turn at PTurn.text label
Turn = PTurn.Text
'Get Current Player position
x = Ppos(Turn).Text
checkplayerpos()
'Move Piece 1 by 1
If dicelabel.Text = 1 Then
On Error Resume Next
Static AA As Integer
If AA > 100 Or AA < 1 Then AA = 1
Select Case AA
Case 1
soundmovement()
PlayerP(Turn).Top = squarelabel(z + x + 1).Top
PlayerP(Turn).Left = squarelabel(z + x + 1).Left
AA = 1
PlayerP(Turn).Enabled = False
x = x + 1
'Show player position
Ppos(Turn).Text = x
Check()
'Move to next player
NextPlayerTurn()
Dice.Enabled = True
Timer2.Enabled = False
End Select
ElseIf dicelabel.Text = 2 Then
On Error Resume Next
Static BB As Integer
If BB > 100 Or BB < 1 Then BB = 1
Select Case BB
Case 1
soundmovement()
PlayerP(Turn).Top = squarelabel(z + x + 1).Top
PlayerP(Turn).Left = squarelabel(z + x + 1).Left
BB = 2
Case 2
soundmovement()
PlayerP(Turn).Top = squarelabel(z + x + 2).Top
PlayerP(Turn).Left = squarelabel(z + x + 2).Left
BB = 1
PlayerP(Turn).Enabled = False
x = x + 2
Ppos(Turn).Text = x
Check()
NextPlayerTurn()
Dice.Enabled = True
Timer2.Enabled = False
End Select
ElseIf dicelabel.Text = 3 Then
.....
ElseIf dicelabel.Text = 4 Then
.....
ElseIf dicelabel.Text = 5 Then
.....
ElseIf dicelabel.Text = 6 Then
....
End Sub
------------------
~Thank you so much for helping me out~
|
|
|
|
|
Pardon me for saying so, but this is spaghetti code. Your code could be doggin' in a variety of places. The ControlArray stuff, but more than likely because you're moving controls around your form. Depending on what's around the point where the control WAS and where it goes TO, and if any of these controls overlap other controls, and if you have an image as a background behind these controls, you could be forcing an abnormally high number of controls to repaint.
Basically, may general rule of thumb is if you have to have more than 20-30 controls on a form to do what you want, you really need to rethink how your presenting the user an interface. You could GREATLY increase the performance of your app by not using all these controls and just painting the interface yourself with small bitmaps. But, this would require a rewrite of most of your code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
yes i feel that so also... but limit knowleadge on vb.net... there are ppl suggest me to use the x,y coordinate to replace the player token which i only need 100 label instead of the 400 label to place the player position...but i will leave firsr when i have the time will try modify it. Can u help me look at this area? which i cant run my subgame properly
http://www.codeproject.com/script/comments/forums.asp?forumid=1646#xx1414125xx[^]
|
|
|
|
|
I don't have the time to be rewriting someones code. On top of that, I get the feeling this is homework or something else for a class.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
oh i think u have misunderstand my meaning i mean pls help me check on my other problem which about other things not to rewrite the code. but anyway i already found out the solution. thanks for ur time.
|
|
|
|
|
On instantiation, web site loads a java applet. I need to wait until the applet if fully loaded before I can LogIn. I can set the cursor to the correct Window position for LogIn, but it arrives before the applet finishes. I am also unable to make the LogIn box accept the Left_Key_Down/Up and the eventual UserId, Password.
WebPageLoader URLWeb ' Navigates to the web<br />
<br />
Sleep 6000 <br />
<br />
Dim LTime As Date<br />
LTime = Now()<br />
While Time - LTime > 20<br />
DoEvents:(<br />
Wend<br />
<br />
'this happens before the web page loads, the page loads in about 5 seconds!!!<br />
' X/Y need to be passed as Pixels!<br />
xPos = (WebBrowser.Left + 0.9 * WebBrowser.Width) / Screen.TwipsPerPixelX<br />
yPos = (WebBrowser.Top + 0.5 * WebBrowser.Height) / Screen.TwipsPerPixelY<br />
<br />
' Move cursor to destination, first<br />
SetCursorPos xPos, yPos: Sleep 500<br />
MousePointer = vbArrow<br />
<br />
'Map into same coordinate space used by mouse_event.<br />
xPos = (xPos / GetSystemMetrics(SM_CXSCREEN)) * &HFFFF&<br />
yPos = (yPos / GetSystemMetrics(SM_CYSCREEN)) * &HFFFF& <br />
<br />
If Me.WindowState = vbMinimized Then Me.WindowState = vbNormal<br />
Me.SetFocus<br />
<br />
Dim hWnd As Long<br />
'hWnd = GetForegroundWindow()<br />
hWnd = WebBrowser.hWnd<br />
<br />
'here are 3 methods that I have tried<br />
Call mouse_event(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_ABSOLUTE, xPos, yPos, 0, 0)<br />
Sleep 250<br />
Call mouse_event(MOUSEEVENTF_LEFTUP Or MOUSEEVENTF_ABSOLUTE, xPos, yPos, 0, 0)<br />
Sleep 250<br />
<br />
Dim lng As Long<br />
lng = SendMessageVal(hWnd, MOUSEEVENTF_LEFTDOWN, 1, 0)<br />
lng = SendMessageVal(hWnd, MOUSEEVENTF_LEFTUP, 1, 0)<br />
<br />
'lng = Send_Key_Code(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_ABSOLUTE, lHandle, False, False, False)<br />
'lng = Send_Key_Code(MOUSEEVENTF_LEFTUP Or MOUSEEVENTF_ABSOLUTE, lHandle, False, False, False)<br />
<br />
SendKeys "xxxx@yahoo.com", True: Sleep SleepTime 'UserID<br />
SendKeys (vbTab), True: Sleep SleepTime<br />
SendKeys "xxxxx", True: Sleep SleepTime 'password<br />
SendKeys vbCr, True
"Good software like good food takes time to prepare"
Winnie-the-Pough"
|
|
|
|
|
Hi,
I have a VB Project that needs Unicode support. I use Textbox, listview, treeview,and labels. I replaced the default textbox with Microsoft forms2.0 object library's textbox in the application, but this too fails to display many of the characters.There are no Treeview and Listview in Microsoft forms2.0 object library. Someone please help me.
Thanks & Regards
Ranjan
|
|
|
|
|
Ummm....Everything in VB is stored in Unicode. Could it be that the characters you're trying to display don't exist in the font that your using?
Which VB are you using? What's the O/S on the machine? It could also be that your O/S doesn't support it. Win9x installations had to have Unicode support added to the O/S after installation...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I am developing a project in vb.net. So, I have made login screen. After the user is validated, I need to open the next screen. I am using the code like:
Dim AdminPage As New frmMDI
AdminPage.Show()
Me.Dispose()
This piece of code works fine in the other vb.net project. But here, after the user is validated, instead of opening the next page, the project stops running. Even in the debug mode also, I am unable to find out the problem as the program stops running. So, please let me know, how can I solve this problem?
With Regards,
Sheshadrinath.R
|
|
|
|
|
Dim AdminPage As New frmMDI
AdminPage.Show()
Me.Dispose()
u may have current form as start up page (Me) so when u say Me.Dispose() then ur application get Dispose bcoz ur main from of application is current form(Me)
so inted of Me.Dispose() use Me.Hide()
it will solve the problem
if u have some prob with that plz reply me on my id
harshad_pednekar@yahoo.com
Regards
Harshad
|
|
|
|
|
Your startup form should be the main application form, not the LoginForm.
You're main form should start up, check some flag to see if the user is logged in, and if not, show the login form. If the login is successful, you can finish starting up your main form. If not, the main form can kill itself and shutdown your app.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
LETS THINK UR LOGIN SCREEN IS IN FORM1
SO U HAVE TO GOTO FORM 2 AFTER VALIDATING
WRITE:
DIM OBJ AS FORM2
OBJ=NEW FORM2
OBJ.SHOW()
ME.HIDE()
|
|
|
|
|
i have a vb application with me. I have used dsn for connecting to database. i want to make a installation package using package and deployment in vs 6.0. Here how can i integrate the dsn?. is there any way so that the dsn automaticaly comes when i install the software in the system.
thanking you
hari
|
|
|
|
|
I haven't used a DSN in almost 10 years... Let's see, ...., there's Creating a File DSN[^] that you could use to gleen some information from. You'd probably have to include this in your installation package and include a custom installer .EXE to install it. There's also some useful stuff in Creating a Machine DSN[^] that you can poke into the registry.
This is going to come down to what your abilities are and what you can pull off with them. I don't think you're going to find much in the way of having this installed for you automatically.
...but, then again, it's been 10 years since I've used one...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I need to use WinSock in vb6.0 to read emails of different accounts. Is any one know from where i could b able to get help on this.
Thanx
Noshaba
|
|
|
|
|
You'd be writing your own implementation of a POP3 and SMTP clients. The topic is WAY too big to go into in a forum environment. If you've got specific questions about the implementation, we can help you with that. But the question you posted is so general, all we can do is point you in the direction of Google:
Results[^] for "VB6 pop3 client"
Results[^] for "VB6 smtp client"
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I guess i didnt search much in net to get what i want in simple few lines of code
all i want to do is change the button submit to plesae wait and disableit as soon as they click submit so that i can prevent from them to submit again.
|
|
|
|
|
To save you the trouble of reading the manual... in the cmdSubmit_Click() event (assuming your Submit button is named cmdSubmit) ...
cmdSubmit.Text = "Plesae Wait"<br />
cmdSubmit.Enabled = False
Simple huh?
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
i assume those codes will be stored in server side i am talking about when the internet connection is slow. let says. while user uploads the file and the progress bar goes up till the image upload is complete there could be chance they can upload it again. if the internet connection is fast the effect of that code will not be visible. i dont know correct me if i am wrong.
thanks once again.
|
|
|
|
|
foremorecoast1 wrote: i assume those codes will be stored in server side i am talking about when the internet connection is slow
Well you didn't tell me that it was a web app. In this case I agree with Dave. If it is a non-web app, the code I gave you will work just fine.
Be more specific in your questions and RTFM a bit more.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
You don't want to be doing that...
Simply because if the POST (button click) fails for any reason, the user will not have the option of going back and clicking Submit again.
You'd be much better off writing your code to handle the situation where it might see the same request twice, or more.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|