|
|
Title | Catch a form's minimize and maximize messages and optionally cancel them in Visual Basic .NET |
Description | This example shows how to catch a form's minimize and maximize messages and optionally cancel them in Visual Basic .NET. |
Keywords | minimize, maximize, cancel minimize, cancel maximize, catch events, Visual Basic .NET, VB .NET |
Categories | VB.NET, Windows, Controls |
|
|
Thanks to Gary Winey (j2associatesNO_SPAM@yahoo.com). This example subclasses a from by overriding its WndProc method to watch for Windows events. When it receives a message indicating that the form is about to minimize, maximize or restore, the event listener raises an event to let the main program know. The program then displays a message box that lets you cancel the operation.
Note that you could easily modify the WndProc code to watch for other events.
See the code for the additional details.
|
|
|
|
|
|
|
|
|