Was form miximized while closing?

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.
 
C

Chris Dunaway

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top