I'm writing a "multi-screened" application in C#. The "screens" represent different areas of the program i.e. Settings, Restricted Access, Administration, etc.
The problem I'm having is when I'm transitioning between one panel and another. During the transition process, the whole form momentarily glitches and the outlines of some of the controls can be seen. Any text on the panels appears as a block with the background of the other panel and other weird things occur.
Here's some screenshots of what I'm trying to explain...
Here's what the panel I'm transitioning to SHOULD look like:
and here's what happens in the transitioning process:
I have a function that I use to transition between the panels. The code is as follows:
delegate void DtransPanel(object pan1, object pan2);
private void transPanel(object hide, object show)
{
if (InvokeRequired) Invoke(new DtransPanel(transPanel), new object[] { hide, show });
else
{
Panel h = (Panel)hide;
Panel s = (Panel)show;
h.Hide();
Application.DoEvents();
s.Show();
}
}
I'm a complete novice when it comes to graphics and such-like. There is probably a better method than using the function above :P
My apologies if there is a similar question that I haven't found (I did search around) or if I've made the noobiest mistake on the planet...