I'm looking to execute a function when the Max button is clicked.

I'd like to override the maximize event on an MDI child form so that
instead of maximizing, it just fills the MDI area. I've found the code
to max the form to the mdi size, but no luck on how to execute my
function on the Max button click.

I've been looking for a solution, but still no luck. I found the
"MinMaxFormSize" article but it's not quite what i'm looking for.

Thanks for any help.

rich
- vb.net '03

Re: override maximize event by Herfried

Herfried
Wed Jul 12 08:11:00 CDT 2006

<rich@rwbaker.com> schrieb:
> I'm looking to execute a function when the Max button is clicked.
>
> I'd like to override the maximize event on an MDI child form so that
> instead of maximizing, it just fills the MDI area. I've found the code
> to max the form to the mdi size, but no luck on how to execute my
> function on the Max button click.

Handle the form's 'Resize' event and check its 'WindowState'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Re: override maximize event by rich

rich
Wed Jul 12 09:05:42 CDT 2006

Of course it's that easy, hah. Thank you!

Now, should I do this:

If Me.WindowState = FormWindowState.Maximized Then
Me.WindowState = FormWindowState.Normal
childMax()
End If

which results in a bit of flash since it's maximizing then going back
to normal, or is there a way to capture the max before it happens?

Thanks again!