Carlos Armendia
Carlos Armendia

Reputation: 57

Un-maximize size of the form

I'm having a little something in my program that's bothering me and I would like some help please.

My form size is: 1366; 768 (that's the max resolution of the laptop I use). The form loads and it's a little bit smaller than my screen size, so I changed the load event of the form so that it starts maximized.

Private Sub form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.WindowState = FormWindowState.Maximized
End Sub

Now, when I press the maximize button while the form is maximized (un-maximize), the form gets a little bit smaller. Can I choose what size to un-maximize? I want the form to be 800 x 600 when I press that button.

Thanks in advance.

Upvotes: 0

Views: 206

Answers (1)

LarsTech
LarsTech

Reputation: 81620

Well, if you need the un-maximized event to be different than the designer size, then just set it in your OnLoad override:

Protected Overrides Sub OnLoad(e As EventArgs)
  MyBase.OnLoad(e)

  Me.WindowState = FormWindowState.Maximized
  Me.Size = New Size(800, 600)
End Sub

Upvotes: 1

Related Questions