Was form miximized while closing?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to store state of the form such as X and Y position, size, height of
GridView on this form when form is closed. Then on load I want to reload this
state.

The question is how do I know if form was in maximized state while closing
and would appreciate if you could point me to example of doing above task.
 
I want to store state of the form such as X and Y position, size, height of
GridView on this form when form is closed. Then on load I want to reload this
state.

The question is how do I know if form was in maximized state while closing
and would appreciate if you could point me to example of doing above task.

Have you looked at the WindowState property?

VB

Private Sub Form1_FormClosing(...) Handles Me.FormClosing
If Me.WindowState = FormWindowState.Maximized Then
'Do something
End If
End Sub

C#
private void Form1_FormClosing(object sender,
FormClosingEventArgs e) {
if (this.WindowState == FormWindowState.Maximized) {
//Do something
}
}

Chris
 
Back
Top