Background shows while switching between forms

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.
 
J

Jeffrey Tan[MSFT]

Hi Naveed,

Thanks for your post.

Currently with your post description, it is hard for me to reproduce out
your problem on my side. Can you post a little sample .Net project for us
to reproduce the problem? Then we can understand your problem much better
and provide some useful reply.

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi Naveed,

Does my reply make sense to you? Do you still have any concern, please
feel free to tell me. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
N

Naveed Ahmed

Thanks for the reply. For some reason, Outlook Express isn't showing your
last message. I just saw it with the web based client.

I was trying to avoid using the same form, as the business logic is very
different on every form.

The project is really targeted to the Pocket PC (the project I uploaded is
in VGA mode, not QVGA mode), so SetStyle and ControlStyles dont work.

I found a funny work-around. I hope you can shed some light on it. When
Wisbar Advance http://www.lakeridgesoftware.com/wisbar/ is running, the
flickering especially the task bar, showing up, is dramatically reduced.
This doesn't happen with the other Wisbar editions.

Naveed
 
J

Jeffrey Tan[MSFT]

Hi Naveed,

Thanks for your feedback.

I think doing partial painting on the form is a way of reducing flicker.
Currently, I can not share any more information on the product you
provided, because it is a third-party product. I hope some other community
members may help you on this.

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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