By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,490 Members | 1,489 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,490 IT Pros & Developers. It's quick & easy.

Intensive flickering

P: n/a
I have some forms with maybe around 30 controls on each and anytime I load
these forms different parts of it start flickering though not all of them at
once and not the same ones everytime. the forms are each generally separated
into 2-3 different panels and they start flickering with no apparent pattern.
I've tried turning on double buffering, same thing, no improvements. I've
tested it on different computers with different specifications and have
gotten more or less the same result. My own PC is an Intel P4 3.0Ghz
HT-enabled, 1 GB DDRII RAM, NVIDIA 6600GT 128 MB DDR3 RAM, 160GB Western
Digital Caviar 7200RPM (irrelevant really) running Windows XP Pro SP2, So I
see no reason for such flickering.
Btw each of the panels has a background image (PNGs) and most of the buttons
also have images. Most labels use a transparent background.
Any ideas?
Mar 26 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
What are you doing when this flickering is occuring? Modifying controls?
Running through a paint method? Changing a datasource?

- Mark
On Mon, 27 Mar 2006 06:44:19 +0800, n00b <n0**@discussions.microsoft.com>
wrote:
I have some forms with maybe around 30 controls on each and anytime I
load
these forms different parts of it start flickering though not all of
them at
once and not the same ones everytime. the forms are each generally
separated
into 2-3 different panels and they start flickering with no apparent
pattern.
I've tried turning on double buffering, same thing, no improvements. I've
tested it on different computers with different specifications and have
gotten more or less the same result. My own PC is an Intel P4 3.0Ghz
HT-enabled, 1 GB DDRII RAM, NVIDIA 6600GT 128 MB DDR3 RAM, 160GB Western
Digital Caviar 7200RPM (irrelevant really) running Windows XP Pro SP2,
So I
see no reason for such flickering.
Btw each of the panels has a background image (PNGs) and most of the
buttons
also have images. Most labels use a transparent background.
Any ideas?


Mar 27 '06 #2

P: n/a
Sorry for the late reply.
When the flickering is happening the code is doing nothing, the parts of the
form just continuosly flicker. I'm not doing any paint menthod other than the
ones that are specific to each control. As for modifying controls the only
modification I make at any time is just showing a given panel and hiding all
other extra ones. I'm not using a datasource for data either, on form load
some data is added to the approriate listboxes... manually in the code, and
this is done inside a BeginUpdate and EndUpdate.

"Mark Harris" wrote:
What are you doing when this flickering is occuring? Modifying controls?
Running through a paint method? Changing a datasource?

- Mark
On Mon, 27 Mar 2006 06:44:19 +0800, n00b <n0**@discussions.microsoft.com>
wrote:
I have some forms with maybe around 30 controls on each and anytime I
load
these forms different parts of it start flickering though not all of
them at
once and not the same ones everytime. the forms are each generally
separated
into 2-3 different panels and they start flickering with no apparent
pattern.
I've tried turning on double buffering, same thing, no improvements. I've
tested it on different computers with different specifications and have
gotten more or less the same result. My own PC is an Intel P4 3.0Ghz
HT-enabled, 1 GB DDRII RAM, NVIDIA 6600GT 128 MB DDR3 RAM, 160GB Western
Digital Caviar 7200RPM (irrelevant really) running Windows XP Pro SP2,
So I
see no reason for such flickering.
Btw each of the panels has a background image (PNGs) and most of the
buttons
also have images. Most labels use a transparent background.
Any ideas?


Mar 28 '06 #3

P: n/a
Are you calling your methods to hide and show controls from within any
paint methods?

Mar 28 '06 #4

P: n/a
I'm not calling any methods in any of the paint methods, just in the load
method of the form and the OnClick events of buttons. (Btw just for future
reference is it bad to call such methods in paint methods?, Thnx)

"Steven Nagy" wrote:
Are you calling your methods to hide and show controls from within any
paint methods?

Mar 28 '06 #5

P: n/a
Well you have to be careful not to get caught in an infinite loop where
in your paint method you are doing something that tells the control to
repaint itself, thus causing constant repainting and thus flickering,
which is why I asked.

You could investigate the SetStyle method of controls, which might
alleviate some flickering, but you can't access this method without
inheriting from the control.
So for example, your panels would actually be n00bPanels, which in turn
inherit from Panel, and give them a method called SetStyle() which
calls the Panel base SetStyle method. There are SetStyle enums that
will help with flickering, but I would say that there is something else
that really needs attention.

Are you using a layout manager per chance for all those controls? How
are the panels placed, are they docked or anchored?
Are you handling the resize events for anything?

its a hard one...

Mar 29 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.