D
Dave Veeneman
I'm drawing a graphic directly to a form, using a Paint event handler. All
works well, except that the graphic flickers when I resize the form. So, I
implement double-buffering for the form using the following function:
public void EnableDoubleBuffering()
{
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.UpdateStyles();
}
I call the function from the form's constructor, and I get an
ArgumentException saying that an invalid parameter was used.. The call stack
indicates the exception is thrown in the System.Drawing library.
The code runs fine if I disable the EnableDoubleBuffering() call, but of
course I still have flicker.
Am I missing something here? Any help figuring this out is much appreciated.
Dave Veeneman
Chicago
works well, except that the graphic flickers when I resize the form. So, I
implement double-buffering for the form using the following function:
public void EnableDoubleBuffering()
{
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.UpdateStyles();
}
I call the function from the form's constructor, and I get an
ArgumentException saying that an invalid parameter was used.. The call stack
indicates the exception is thrown in the System.Drawing library.
The code runs fine if I disable the EnableDoubleBuffering() call, but of
course I still have flicker.
Am I missing something here? Any help figuring this out is much appreciated.
Dave Veeneman
Chicago