Reputation: 13
I'm looking for code in c # in VB 2013 to prevent the user can't move, maximize and minimize a Form
This Form should be maximized when it opens.
Thanks for your help.
Upvotes: 0
Views: 1827
Reputation:
This will get you started.
this.WindowState = FormWindowState.Maximized;
this.ControlBox = false;
All of these are properties you can set in the form properties menu. You can either add them there or in your code somewhere. These kill the menus and such and don't allow your user to minimize, maximize, of move a form (i.e. makes it splash screen).
You might want to add this if you don't just want to kill the menu -
private void Form1_Resize ( object sender , EventArgs e )
{
if ( this.WindowState == FormWindowState.Minimized )
{
this.WindowState = FormWindowState.Maximized;
}
}
Upvotes: 1