Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen Flicker dim Excel Discussion (Misc queries) 4 November 28th 07 09:42 PM
changing image control's picture path No Name Excel Programming 2 October 5th 04 08:09 PM
Programatically changing picture in UserForm - VBA - Mac OSX dirk Excel Programming 2 May 14th 04 12:40 PM
Screen Flicker when changing row height Ian Webster Excel Programming 2 April 7th 04 03:53 PM
userform image from picture in worksheet Doug Glancy[_5_] Excel Programming 2 November 10th 03 04:43 AM


All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"