N
Naveed Ahmed
I have an multi-form application, which uses owner drawn buttons that use
bitmaps. I switch between forms using:
public void ActivateForm(FormBase form)
{
if (form == this.activeForm)
return;
form.Show();
form.Enabled = true;
this.activeForm.Hide();
this.activeForm = form;
}
The switching works fine, but a very brief moment when the switching occurs,
the background shows, causing a flicker-like effect. I should mention that
the application is on .NET CF. I am also compiling it to .NET, where all the
code is shared except for a hand full of lines using #if(PocketPC). The
flicker-like effect is also present on the PC, but much less so, probably
because of the faster hardware.
I have tried double-buffering drawing the whole form, using the form's
OnPaint() rather than the controls' OnPaint(), but this seemed to slow down
the drawing further, and the flicker is more pronounced on the desktop but
shows a white background, rather than what is behind the form. And the
bitmap buttons dont even show up on .NET CF, just the background. Looks to
me like double-buffering is out.
The bitmap buttons use transparent bitmaps, but I tried using regular
bitmaps, but the problem still exists, in both CF and regular .NET.
bitmaps. I switch between forms using:
public void ActivateForm(FormBase form)
{
if (form == this.activeForm)
return;
form.Show();
form.Enabled = true;
this.activeForm.Hide();
this.activeForm = form;
}
The switching works fine, but a very brief moment when the switching occurs,
the background shows, causing a flicker-like effect. I should mention that
the application is on .NET CF. I am also compiling it to .NET, where all the
code is shared except for a hand full of lines using #if(PocketPC). The
flicker-like effect is also present on the PC, but much less so, probably
because of the faster hardware.
I have tried double-buffering drawing the whole form, using the form's
OnPaint() rather than the controls' OnPaint(), but this seemed to slow down
the drawing further, and the flicker is more pronounced on the desktop but
shows a white background, rather than what is behind the form. And the
bitmap buttons dont even show up on .NET CF, just the background. Looks to
me like double-buffering is out.
The bitmap buttons use transparent bitmaps, but I tried using regular
bitmaps, but the problem still exists, in both CF and regular .NET.