Question bring form to front

aronmatthew

Active member
Joined
Aug 5, 2019
Messages
41
Programming Experience
Beginner
in a c# windows form project i have created and showed a new form within the main form load
the problem is nothing is working to bring it to the front and since its a setting dialog for new users and required for the program to run i need the 2nd form to show on top of the main form
all of these methods with the 2nd form load and nothing works

C#:
this.WindowState = FormWindowState.Minimized;
this.Show();
this.WindowState = FormWindowState.Normal;


this.TopMost = true;
this.Focus();
this.BringToFront();
this.Activate();
this.Focus();
 
Last edited by a moderator:
You should be displaying the second form from the Shown event handler of the first, not the Load event handler. That way, the first form has already been displayed so there's nothing extra to do.
 
Back
Top Bottom