Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Reduce Flickering using Application.ScreenUpdating


I am trying to mimic a "popup" in excel by setting a group of
buttons/labels visible to true or false. My problem comes when I click
on a button and that button runs a function to show/hide a the specific
group. here's an example

Private Sub togShowgrp_Click()
If togShowgrp.value = true then
showgrp(TRUE)
else
showgrp(FALSE)
End If

end sub

Function showgrp(Show as Boolean)
Application.ScreenUpdating = False
lblBackgrd.visible = show
cmdPlus1.visible = show
cmdMinus1.visible = show
Application.ScreenUpdating = True

end Function


These buttons/labels are on top of a large label already and whenever
the button is clicked the screen flickers (all the pictures and
labels/buttons on the spreadsheet disappear for a second) My Question
is, Is there another way to show the group without the screen flicker
using something like Application.ScreenUpdating but on a smaller level,
or use the ScreenUpdating a bit better to avoid the annoying flicker?
Thanks in Advance.


--
Xiazer
------------------------------------------------------------------------
Xiazer's Profile: http://www.excelforum.com/member.php...o&userid=31581
View this thread: http://www.excelforum.com/showthread...hreadid=536722

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Reduce Flickering using Application.ScreenUpdating

Xiazer,

My first thought is 'why is showgrp a function?'. Without actually
testing the code I'm surprised it works at all.

The purpose of a function is to return a value based on arguments
passed to it. It is not normally capable of making changes to the GUI.

Try simply changing the Function keyword to Sub and see if that fixes
the problem.

HTH,
NickH.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Reduce Flickering using Application.ScreenUpdating

Xiazer,
I would guess it is because Excel has to redraw all the object on the
graphics layer when any of them are hidden/shown.
If there are many objects, then this redraw becomes noticeable.

Could you use a modeless userform that floats over the sheet instead ?

NickHK

"Xiazer" wrote in
message ...

I am trying to mimic a "popup" in excel by setting a group of
buttons/labels visible to true or false. My problem comes when I click
on a button and that button runs a function to show/hide a the specific
group. here's an example

Private Sub togShowgrp_Click()
If togShowgrp.value = true then
showgrp(TRUE)
else
showgrp(FALSE)
End If

end sub

Function showgrp(Show as Boolean)
Application.ScreenUpdating = False
lblBackgrd.visible = show
cmdPlus1.visible = show
cmdMinus1.visible = show
Application.ScreenUpdating = True

end Function


These buttons/labels are on top of a large label already and whenever
the button is clicked the screen flickers (all the pictures and
labels/buttons on the spreadsheet disappear for a second) My Question
is, Is there another way to show the group without the screen flicker
using something like Application.ScreenUpdating but on a smaller level,
or use the ScreenUpdating a bit better to avoid the annoying flicker?
Thanks in Advance.


--
Xiazer
------------------------------------------------------------------------
Xiazer's Profile:

http://www.excelforum.com/member.php...o&userid=31581
View this thread: http://www.excelforum.com/showthread...hreadid=536722



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Reduce Flickering using Application.ScreenUpdating

Hi Xiazer,

you may get better result if you don't use application.screenupdating
at all.

Also speeding up your code could avoid screen flickering (you can speed
up your code by showing/hiding directly in Private Sub
togShowgrp_Click(), not by calling Function showgrp. Anyway, you don't
use its return value).

Regards,
Ivan

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
FLICKERING...(fore ground font color with flickering).. Eddy Stan Excel Discussion (Misc queries) 5 March 23rd 06 06:20 PM
application screenupdating issue Gary Keramidas Excel Programming 4 March 11th 06 02:45 AM
PLEASE PLEASE HELP Application.Screenupdating modjoe23[_6_] Excel Programming 3 September 3rd 05 05:08 AM
problem with Application.ScreenUpdating Betty[_2_] Excel Programming 8 July 23rd 04 09:51 PM
Application.ScreenUpdating = False Pieter Kuyck Excel Programming 2 July 15th 03 06:28 PM


All times are GMT +1. The time now is 05:04 AM.

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

About Us

"It's about Microsoft Excel"