Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleCatch a form's minimize and maximize messages and optionally cancel them in Visual Basic .NET
DescriptionThis example shows how to catch a form's minimize and maximize messages and optionally cancel them in Visual Basic .NET.
Keywordsminimize, maximize, cancel minimize, cancel maximize, catch events, Visual Basic .NET, VB .NET
CategoriesVB.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.

 
 
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated