|
-
Jul 10th, 2000, 02:59 PM
#1
Thread Starter
Addicted Member
Hello!
Why does vb control flashes when their property value is changed very fast, let's say like this:
for i=1 to 2500
label1.width=i
label1.refresh
next
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Jul 10th, 2000, 03:02 PM
#2
It's the updating speed of your Monitor.
-
Jul 10th, 2000, 03:11 PM
#3
Thread Starter
Addicted Member
Huh...
And what can I do against that?
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Jul 10th, 2000, 03:24 PM
#4
You can try 1 of 2 things. First, try removing the Label1.Refresh line. It will not blink as much.
If that does not satisfy you, then you can use the LockWindowUpdate API.Make sure you enclose your Label in a container (like the PictureBox) because we'll lock that instead of the Form. If we lock the Form, then it will freeze.
Make a Form with a PictureBox, CommandButton and a Label. Place the Label inside the PictureBox and insert the following code into the Form.
Code:
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
Private Sub Command1_Click()
LockWindowUpdate Picture1.hWnd
For i = 1 To 2500
Label1.Width = i
Label1.Refresh
Next
End Sub
-
Jul 10th, 2000, 06:19 PM
#5
Thread Starter
Addicted Member
And if I do that, the label1 will still be refreshed without flashing?
Let me explain what am I doing. I have 2 labels. In first is static text and in second which is dynamicly resizing is the same text, just colored with some other color. The point of my program is to resize the label at specific milisecond to specific width to color text for singing (kind a caraoke thing).
It's complicated explained, but I hope you'll understand.
Or is there any other way to do it?
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Jul 10th, 2000, 07:10 PM
#6
LockWindowUpdate will not work in your case then. Try removing the Label1.Refresh line.
Code:
For I = 1 to 2500
Label1.Width = I
Next I
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|