• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 170
  • Last Modified:

Image control flickers?

When using the .Move for an Image, the picture flickers. Is there any way to avoid this? (Aside from switching to a picturebox control)
0
TeleKawaru
Asked:
TeleKawaru
  • 3
  • 2
1 Solution
 
aeklundCommented:
You can use the api call to lock the window when moving it, then unlock it when done:

Public Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_4i5h.asp
0
 
TeleKawaruAuthor Commented:
The picture still flickers while moving after using that code.
0
 
JoaTexCommented:
Hi
Try This Litlle Code:
Put a Picture box with a picture(not very Large one)in a form and use this code:

Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
   If KeyCode = 39 Then
      For n = 1 To 100
         x = Picture1.Left
         y = Picture1.Top
         Picture1.Move x + 1, y
         Form1.Refresh
      Next n
   End If
   If KeyCode = 37 Then
      For n = 1 To 100
         x = Picture1.Left
         y = Picture1.Top
         Picture1.Move x - 1, y
         Form1.Refresh
      Next n
   End If
End Sub

Hope it Suites you
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
TeleKawaruAuthor Commented:
Actually I was talking about Image Controls. Not Picture boxes.
0
 
aeklundCommented:
I'm not sure if this will be of any help, but while I was searching for something else, I ran accross this article:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dngdi/html/msdn_flicker.asp
0
 
aeklundCommented:
Did that work for you?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now