nevermind... solution is e.Cancel (to stop the Closing event) and
e.CloseReason.
(e is the FormClosing eventarg)
Thanks,
Seth Rowe
------------------------------------------------------
> Is there a way I can get into a form's close/minimize/maximize events when
> those buttons (the 3 small squared button in the upper right corner of a
> form) are clicked?
\\\
Private Const WM_SYSCOMMAND As Int32 = &H112
Private Const SC_MAXIMIZE As Int32 = &HF030
Private Const SC_MINIMIZE As Int32 = &HF020
Private Const SC_RESTORE As Int32 = &HF120
Private Const SC_CLOSE As Int32 = &HF060
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
Select Case m.WParam.ToInt32()
Case SC_MAXIMIZE
Debug.WriteLine("Form gets maximized.")
Case SC_MINIMIZE
Debug.WriteLine("Form gets minimized.")
Case SC_RESTORE
Debug.WriteLine("Form gets restored.")
Case SC_CLOSE
Debug.WriteLine("Form gets closed.")
End Select
End If
MyBase.WndProc(m)
End Sub
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
------------------------------------------------------
set 'cancel = true'
<lord....@gmail.com> wrote in message
news:1164903494....@l39g2000cwd.googlegroups.com...
Not in this case, the e.cancel is in this exit question in my idea the best.
Cor
"rowe_newsgroups" <rowe_...@yahoo.com> schreef in bericht
news:1164904713.0...@j72g2000cwa.googlegroups.com...
I know - whenever I see a post about catching the close button I figure
the next question will be "ok, now how do I trap the other buttons?." I
figured posted it here would help out someone searching the archives
(well, if any one does that anymore :-) )
Thanks,
Seth Rowe