473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 5578
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David | last post by:
Hello I'm writting an apllication and i like to display and offscreen image. However my code doesn't seem to work. It compiles and runs properly but What i want is to associate the button of the...
3
by: Alex Glass | last post by:
I have read plenty about applying double buffering for animation and self drawn forms. Is there a way to apply it to a form with many standard controls on it (textboxes, labels etc) ?? I have...
2
by: MPowell | last post by:
Gents/Ladies, I'm doing (at least plan on ) lots of Reads and Writes across a communication channel. I'm told that for the 'receive side' it'd be prudent to implement a double buffering scheme to...
2
by: Jason | last post by:
I have created a 2d isometric game map using tiles and now I'm trying to move around my map..when i go near the edge of the map I want to redraw the map to show new parts of the map however the...
1
by: Kuba Florczyk | last post by:
Hi I've got some problem doing double buffer. Here is my problem: I've got custom control on which i paint some data (chat messages, lets call it ChatControl), this control is puted on a...
0
by: David Veeneman | last post by:
This post is for the Google archive and does not require a reply. I received an 'Invalid parameter used' error when trying to do double-buffering with the .Net SetStyles method. I used this code...
7
by: Rain | last post by:
Hello Gurus! I really need this one to finish a module in my thesis. PLease please help me. I need a double buffer class so i can call it and use it anytime i want, the problem is everything ive...
1
by: TyBreaker | last post by:
I notice in VB 2005 that I can set a form to be double-buffered just by setting that option to true in the Form properties. I have a panel on that form but there doesn't appear to be a...
3
by: ssoffline | last post by:
hi i have an app in which i can drop objects onto a form and move them, it consists of graphics (lines), i am using double buffering to avoid filckering in the parent control which is a panel,but...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.