double buffering in child controls

  • Thread starter Thread starter ssoffline
  • Start date Start date
S

ssoffline

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 when i add
controls to this panel dyanamically, the double buffering effect is not
there, i move all lines connceted to a control when the control is
moved , at this time flickering occurs,also when i enable double
buffering for a child control an exception is thrown when i drop
control onto the panel
sayiong "Parameter is not valid." , at this line of code
Application.Run(new MainForm());
please help.

Sameer Sood
Microsoft Student partner
NIT Durgapur,india
 
ssoffline said:
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 when i add
controls to this panel dyanamically, the double buffering effect is not
there, i move all lines connceted to a control when the control is
moved , at this time flickering occurs,also when i enable double
buffering for a child control an exception is thrown when i drop
control onto the panel

Double buffering does not carry through to child controls. You need to set
it for each control.
sayiong "Parameter is not valid." , at this line of code
Application.Run(new MainForm());
please help.

This usually happens when an exception is thrown in the paint event, you
need to track down that exception.


Michael
 
the exception is thrown as i have updated styles from within the user
control in addition to the form, the problem is solved when i remove it
from child controls, but if form has all flags enabled then why the
flickering is there, and is there any way to enable double buffering on
user controls?
 
ssoffline said:
the exception is thrown as i have updated styles from within the user
control in addition to the form, the problem is solved when i remove it
from child controls, but if form has all flags enabled then why the
flickering is there,

As I said, double buffering doesn't apply to child controls, you need to
enable it individually. I'm not sure why you're getting an error though.

Michael
 
Back
Top