-
I have an image control that contains an .ICO in the corner of a picture box, but when the picturebox refreshes (which is every few seconds) it makes the image in the image control flicker - Anyway to stop this??
The image control contains an icon with the letters "X Y" in it. It is to help visually ID the XY grid drawn with the LINE command.
If you know how to stop the flicker or have a better way to do this PLEASE LET ME KNOW!! All suggestions (good or bad) accepted. I am at the far end of frustration now!
Thanks for 'da help!
-
heres a soution!!!
Try this api call
Module:
Declare function LockWindowUpdate lib "User32" (byval hWndlock as long) as long
Form code
Dim lerr as long
Dim X as integer
screen.mousepointer = vbhourglass
lerr = lockwindowupdate(me.hwnd)
lerr = lockwindowupdate(0)
screen.mousepointer = vbdefault
hope it helps
-
Nope that did'nt work. Thanks anyways.......anyone else??
-
Use the LockWindowUpdate as MPrestonf12 said, but change Me.hWnd to Picture1.hWnd (Or whatever the name of your PictureBox is.
Assuming you have your code in a Timer, use this code.
Code:
Private Declare Function LockWindowUpdate Lib "User32" (ByVal hWndlock As Long) As Long
Private Sub Timer1_Timer()
Picture1.Refresh
LockWindowUpdate Picture1.hwnd
End Sub