Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen flicker when changing Image.Picture source on UserForm
Hi All
On a UserForm, I have an Image control whose Picture property changes according to the user's selection. The image is a GIF copy of a chart. As the image loads, it flashes across the form, and turning off Application.ScreenUpdating has no effect. I have used Me.Repaint, to force the new image to appear (previously it wasn't). I would like the image to appear without the 'flash' or flicker, if possible. Any suggestions are appreciated. Paul Martin Melbourne, Australia |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen flicker when changing Image.Picture source on UserForm
Hi Paul,
Try adding an identical image control directly on top of the existing control. Then in your code, load the hidden control with the new image, followed by making the top control not visible and the bottom one visible. I've done something similar with text boxes on a form, using the mouse move event and the results are impressive. Regards, Jim Cone San Francisco, USA "Paul Martin" wrote in message om... Hi All On a UserForm, I have an Image control whose Picture property changes according to the user's selection. The image is a GIF copy of a chart. As the image loads, it flashes across the form, and turning off Application.ScreenUpdating has no effect. I have used Me.Repaint, to force the new image to appear (previously it wasn't). I would like the image to appear without the 'flash' or flicker, if possible. Any suggestions are appreciated. Paul Martin Melbourne, Australia |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen flicker when changing Image.Picture source on UserForm
application.screenupdating wonly affects excel's windows. try lockwindowupdate api as in: Option Explicit Private Declare Function FindWindow Lib "user32.dll" Alias _ "FindWindowA" (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Private Declare Function LockWindowUpdate Lib "user32.dll" ( _ ByVal hwndLock As Long) As Long Dim b As Boolean Property Get hwnd() As Long Static h& If h = 0 Then h = FindWindow(IIf(Val(Application.Version) < 9, _ "ThunderXFrame", "ThunderDFrame"), Me.Caption) End If hwnd = h End Property Private Sub UserForm_Click() LockWindowUpdate Me.hwnd If b Then Me.Image1.Picture = LoadPicture("c:\img1.jpg") Else Me.Image1.Picture = LoadPicture("c:\img2.jpg") End If b = Not b LockWindowUpdate 0& End Sub -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Paul Martin wrote : Hi All On a UserForm, I have an Image control whose Picture property changes according to the user's selection. The image is a GIF copy of a chart. As the image loads, it flashes across the form, and turning off Application.ScreenUpdating has no effect. I have used Me.Repaint, to force the new image to appear (previously it wasn't). I would like the image to appear without the 'flash' or flicker, if possible. Any suggestions are appreciated. Paul Martin Melbourne, Australia |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen flicker when changing Image.Picture source on UserForm
how many layers can you use? This sounds like a lot of fun if fade in and out
by several layers. "Jim Cone" wrote: Hi Paul, Try adding an identical image control directly on top of the existing control. Then in your code, load the hidden control with the new image, followed by making the top control not visible and the bottom one visible. I've done something similar with text boxes on a form, using the mouse move event and the results are impressive. Regards, Jim Cone San Francisco, USA "Paul Martin" wrote in message om... Hi All On a UserForm, I have an Image control whose Picture property changes according to the user's selection. The image is a GIF copy of a chart. As the image loads, it flashes across the form, and turning off Application.ScreenUpdating has no effect. I have used Me.Repaint, to force the new image to appear (previously it wasn't). I would like the image to appear without the 'flash' or flicker, if possible. Any suggestions are appreciated. Paul Martin Melbourne, Australia |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen flicker when changing Image.Picture source on UserForm
Only two controls are used.
The new image goes in the one that is not visible, then the visible property of both is switched. Jim Cone San Francisco, USA "Jim at Eagle" wrote in message ... how many layers can you use? This sounds like a lot of fun if fade in and out by several layers. "Jim Cone" wrote: Hi Paul, Try adding an identical image control directly on top of the existing control. Then in your code, load the hidden control with the new image, followed by making the top control not visible and the bottom one visible. I've done something similar with text boxes on a form, using the mouse move event and the results are impressive. Regards, Jim Cone San Francisco, USA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Screen Flicker | Excel Discussion (Misc queries) | |||
changing image control's picture path | Excel Programming | |||
Programatically changing picture in UserForm - VBA - Mac OSX | Excel Programming | |||
Screen Flicker when changing row height | Excel Programming | |||
userform image from picture in worksheet | Excel Programming |