I need close current main window and show new main window.
First load Main.
static class Program
{
[STAThread]
static void Main()
{
var main = new Main();
Application.Run(main);
}
}
In event main I need close and show new clear Main.
I tried so:
private void ChangeUsers()
{
this.Visible = false;
var window = new Main();
window.Show();
this.Close();
}
but this not correct work.
This shows the form modally and lets the form return a DialogResult to indicate whether to re-show the form.