HOWTO: Suppress Maximize & Minimize Buttons on MDI Parent FormLast reviewed: July 3, 1997Article ID: Q137033 |
The information in this article applies to:
SUMMARYThis article shows by example how to suppress the maximize and minimize buttons on an MDI parent form. On non-MDI forms, you can set the MinButton and MaxButton properties to False to disable the form's Minimize and Maximize buttons. However, these properties are not available on an MDI parent form. To disable an MDI form's Minimize and Maximize buttons, you need to use the SetWindowLong Windows API function to change the style of the window.
MORE INFORMATIONBoth of the following examples eliminate the Minimize and Maximize buttons from the main MDI form (MDIForm1). NOTE: Information in the Visual Basic versions 4.0 and 5.0 section applies only to Visual Basic versions 4.0 and 5.0, and information in the Visual Basic 3.0 section applies only to Visual Basic 3.0.
VISUAL BASIC 4.0 AND 5.0 SECTION
Step-by-Step Example
#If Win32 Then Private Declare Function SetWindowLong Lib "user32" Alias _ "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) _ As Long #Else Declare Function SetWindowLong Lib "User" (ByVal hwnd As Integer, _ ByVal nIndex As Integer, ByVal dwNewLong As Long) As Long Declare Function GetWindowLong Lib "User" (ByVal hwnd As Integer, _ ByVal nIndex As Integer) As Long #End If Const WS_MINIMIZEBOX = &H20000 Const WS_MAXIMIZEBOX = &H10000 Const GWL_STYLE = (-16)
VISUAL BASIC 3.0 SECTION
Step-by-Step Example
|
Keywords : kbui PrgCtrlsStd vb4all vb4win vb5all vb5howto vbwin kbhowto
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |