I wanted to hide the main window of my app on startup, so I put this in the constructor:
this.Hide();
This doesn't hide my form though. It seems like I can only get buttons to hide the form. Am I doing something wrong here?
I wanted to hide the main window of my app on startup, so I put this in the constructor:
this.Hide();
This doesn't hide my form though. It seems like I can only get buttons to hide the form. Am I doing something wrong here?
Try setting the visible property of the form to false before it is loaded in the main entry point of your application.
Form1 obj = new Form1();
obj.visible = false;
Application.Run(obj);
Or try setting the co-ordinates of the form to higher location like 9000, 9000.
you can use this line of code. It wont hide it, but it will be minimized:
this.WindowState = FormWindowState.Minimized;
in addition, if you don't want it showing on the task bar either, you can add this line:
this.ShowInTaskbar = false;
But why do you create the form if you don't want it to be visible in the first place?