Drawing of a form

M

Mystique

Hello
I have a problem with drawing of a form....in more detail:
I have a main form that holds more inner forms inside it. Each of these
forms contain a main user control which also hold 5 or 6 smaller user
controls. All of the inner forms have defined the property FormBorderStyle
as FixedDialog (I also tried with value None)
Now when the Inner Form get Drawed in the Main Form first a TitleBar gets
drawn with all the inner user controls and then the Inner form gets drawn
again and the inner user controls also, which makes the form look bad (like
blinking...)
I hope what i wrote was understandable :), and someone knows a solution

Regards,
Mystique
 
G

Guest

try adding this under InitializeComponents()

this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);


that will double buffer your form, hopefully getting rid of the
flicker....if not, then instead of redrawing your entire form using
this.Invalidate() etc, try creating a rectangle the size of what you just
drew and only resize that part of the form....that will eliminate the flicker
 

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