Arkaedus
Arkaedus

Reputation: 13

Don't allow user move, maximize or minimize form in c# and auto maximize form when it opens

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

Answers (1)

user3756683
user3756683

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

Related Questions