override maximize event

R

rich

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
 
H

Herfried K. Wagner [MVP]

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'.
 
R

rich

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!
 

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