DoubleBuffered not working in panel?

L

Luc

For a kiosk-type application I have a form with some labels placed directly
onto it, and an empty panel that covers part of the form.

During program execution, labels are added to and removed from that panel
to display different information.

The form has a background image.

Its DoubleBuffered property = True to avoid flickering during updates, but
double buffering seems to be used only for controls placed directly on the
form, not for those within the panel. Updating the panel without visible
flicker seems to be impossible.


Each "flicker" consists of the background image within the panel's
boundaries first disappearing (replaced by the form background color), and
reappearing immediately thereafter.

When the background image reappears, that doesn't happen in a single
stroke: it becomes visible first for about half of the area. The rest
follows at the next display refresh (I mean monitor vertical sync).


If you ask me, this (disappearing / reappearing in more than one display
refresh) means it is either not being double-buffered, or the working
buffer is copied into the screen buffer to soon, while it is still being
repainted.



The platform is XP Professional (application being developed for later use
on XP Embedded).

The flicker does NOT seem to occur on my development machine, which is
running Vista, but this machine is also equipped with a more performant
processor and display adapter, which may explain the difference too.
 
L

Linda Liu[MSFT]

Hi Luc,

I suggest that you enable double buffering on the Panel itself. Do do this,
derive from the Panel class and set the DoubleBuffered property to true in
the derived class's constructor.

For example:

class MyPanel:panel
{
public MyPanel()
{
this.DoubleBuffered = true;
}
}

Then use the derived Panel control on your form. Please try my suggestion
to see if it can solve your problem.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
L

Luc

Hi Luc,

I suggest that you enable double buffering on the Panel itself. Do do this,
derive from the Panel class and set the DoubleBuffered property to true in
the derived class's constructor.

Thanks a lot, that did the trick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top