|
|
Title | Let the user minimize, maximize, and restore a form, but not resize it in VB .NET |
Keywords | subclass, WindowProc, messages, VB.NET, NET, resize, minimize, maximize |
Categories | Tips and Tricks, API, VB.NET |
|
|
Subclass and look for the WM_SYSCOMMAND message. If the wParam parameter is SC_SIZE, ignore the message. Otherwise call the base class's WndProc method to process the message normally.
|
|
Protected Overrides Sub WndProc(ByRef m As _
System.Windows.Forms.Message)
Const WM_SYSCOMMAND As Long = &H112
Const SC_SIZE As Long = &HF000
' See if this is WM_SYSCOMMAND.
If m.Msg = WM_SYSCOMMAND Then
' Ignore SC_SIZE commands.
If (m.WParam.ToInt32 And &HFFF0&) = SC_SIZE Then _
Exit Sub
End If
MyBase.WndProc(m)
End Sub
|
|
See also Subclass to read Windows messages in VB .NET.
|
|
|
|
|
|