471,571 Members | 1,002 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,571 software developers and data experts.

Double buffering a groupbox

My dialog has groupboxes with slow to redraw controls, to improve the
appearance I want to doublebuffer it. While I can use SetStyle() in the
Dailogs constructor the setting change doesn't get propagated to the
groupbox, and since it's a protected method I can't call groupbox.SetStyle().
I've tried deriving a custom class from System.Windows.Forms.GroupBox and
calling SetStyle from inside of it's constructor and from a new method. Both
were unsuccessful.

I can approximate a groupboxes appearance and get double buffering by
replacing it with a panel and placing a label on it's border but none of the
allowed borders for a panel are the same as the one used by a gb.

Is there any way to either force the GB to doublebuffer itself and contained
controls, or change the appearance of the panels border to more closely match
that of a GB?
Nov 17 '05 #1
2 5361
Double buffering applies only to the surface of the control itself. Not the
child controls within it.

These child controls all have their own windows and handle their drawing
individually so setting the double buffering in a parent will have no
effect.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Dan Neely" <Da******@discussions.microsoft.com> wrote in message
news:9B**********************************@microsof t.com...
My dialog has groupboxes with slow to redraw controls, to improve the
appearance I want to doublebuffer it. While I can use SetStyle() in the
Dailogs constructor the setting change doesn't get propagated to the
groupbox, and since it's a protected method I can't call
groupbox.SetStyle().
I've tried deriving a custom class from System.Windows.Forms.GroupBox and
calling SetStyle from inside of it's constructor and from a new method.
Both
were unsuccessful.

I can approximate a groupboxes appearance and get double buffering by
replacing it with a panel and placing a label on it's border but none of
the
allowed borders for a panel are the same as the one used by a gb.

Is there any way to either force the GB to doublebuffer itself and
contained
controls, or change the appearance of the panels border to more closely
match
that of a GB?

Nov 17 '05 #2


"Bob Powell [MVP]" wrote:
Double buffering applies only to the surface of the control itself. Not the
child controls within it.

These child controls all have their own windows and handle their drawing
individually so setting the double buffering in a parent will have no
effect.


Hmmm. How can I stop the flicker whenever I resize my form. Putting my
controls in a groupbox makes the problem worse than leaving them on the main
form or sticking them in a panel instead. I've also managed to improve
performance a bit by setting Bounds instead of making seperate Size and
Location changes. Is there a way to stop redraws until my Resize event
completes it's work.

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by David | last post: by
3 posts views Thread by Alex Glass | last post: by
2 posts views Thread by MPowell | last post: by
2 posts views Thread by Jason | last post: by
1 post views Thread by Kuba Florczyk | last post: by
reply views Thread by David Veeneman | last post: by
7 posts views Thread by Rain | last post: by
1 post views Thread by TyBreaker | last post: by
3 posts views Thread by ssoffline | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.