>Hi,
> I am developing an simple ActiveX progress bar using VB as a practise.
> I use picture box as container, shape control as progress bar
> I found that, when I have a loop to update the width of shape control, the control keep flashing. I can see some white line moving there... how could I avoid this? Are there any LOCKSCREEN equivalent function in VB?
>
Maybe this code will help you!
First, in the General Declarations, copy this API declaration:
Private Declare Function LockWindowUpdate _
Lib "user32" _
(ByVal hwndLock As Long) As Long
Then, to lock a particular control, you can use this:
LockWindowUpdate grdResult.hwnd
Finally, you have to unlock it once the update is done like this:
LockWindowUpdate 0&
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com