override maximize event

  • Thread starter Thread starter rich
  • Start date Start date
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
 
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'.
 
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!
 
Back
Top