2

To load a new form by button click I use

Form2 ss = new Form2();
ss.Show();
this.Hide();

But there is a blink like effect when switching between forms.
Is there a way to remove that effect.
If not how to preserve the consistency of the application when switching between forms.

3 Answers3

1

Use instead a container such as a panel, and turn off drawing between hiding one panel and showing another, and then re-enable drawing, as shown here: How do I disable updating a form in Windows Forms?

This gif demonstrates well: the red and blue parts of the form are panels, with the controls your two forms would have on them. Notice, there's no flicker.

Aidan Connelly
  • 164
  • 3
  • 13
1

You basically have 2 different forms. By calling this.Hide() you're just hiding the current form and showing another one. This can result in the "blink" effect that you described. To achieve what you want, removing the "blink" effect, you have to work with just one form and different layers.

Xzibitee
  • 149
  • 4
1

Set DoubleBuffered property true in Form2. DoubleBuffered=True