Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows forms graphical object upper limit?

Status
Not open for further replies.

j0em0mma

Programmer
Jul 31, 2003
131
US
I have a neat template I designed that takes care of most of my application. It has a main splitscreen control and two nested splitscreen objects, one of which contains a nested splitscreen. All of the exposed splitscreen panels themselves contain a panel object. One of the panels loads a subform depending upon where the user is in the app. Some of the panels have gradients that are applied when their element is painted.

This thing flickers a little when first loaded, but then quites down. I added ONE more splitscreen (plus 2 nested panels) and now the thing flickers for a good second every time I resize the app or load the new form.

Has anyone run into an upper limit on graphics in windows forms applications, or a discussion on this topic? Seems a little strange that vb.net is worse than asp.net with graphical problems, considering IE is sitting on top of the same libraries windows forms is sitting on, and has to call those to create an html display...
 
I would try double buffering the controls which have the gradients painted on.
 
Thx RiverGuy,

From what I've read after your post, this looks quite promising. Haven't found a good example of how to employ it yet. Do you (or does anyone) know of a good discussion on this topic?
 
Look into calling SuspendLayout and ResumeLayout when you make a lot of changes to the controls in your form (like making a hidden tab visible). It delays all the Layout messages until the very end, which should speed things up significantly.

You need to call those methods on the control containing the controls that are having difficulty painting. Your tab control, for instance.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Chip H,

Where would I put this, on the resize event of the containing splitter.panel? That seems kinda pointless though, 'cuz you'd just turn it off then turn it back on again. I must be missing something.
 
I find that you can specify BeginResize and EndResize on the form object, but not on any of objects appearing on the form. I have placed Me.SuspendLayout() in the Form.BeginResize Event, and Me.ResumeLayout in the Form.EndResize Event, but so far there hasn't been an improvement.
 
A Double Buffer is a process that draws an image (the gradient in your case) to a bitmap in memory first, then draws that image to the form. It is very good at getting rid of flickers when you have to redraw a background with a new foreground item. Not sure how much it will help here, but it's worth a try.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top