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.

--
Thanks,
Mahesh

Re: Was form miximized while closing? by Chris

Chris
Wed Jul 25 15:21:01 CDT 2007

On Jul 25, 3:06 pm, Mahesh Nimbalkar
<MaheshNimbal...@discussions.microsoft.com> wrote:
> 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.
>
> --
> Thanks,
> Mahesh

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