|
|
|
|
|
Dicas
|
|
Visual Basic (Forms/MDI)
|
|
|
Título da Dica: Removendo os Botões MIN-MAX de Forms MDI
|
|
|
|
Postada em 14/8/2000 por Webmaster
webmaster@vbweb.com.br
'Coloque o seguinte código num módulo:
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
Private Const WS_MINIMIZEBOX As Long = &H20000 Private Const WS_MAXIMIZEBOX As Long = &H10000 Private Const GWL_STYLE As Long = (-16)
'No evento MDIForm_Load do MDIForm:
Sub MDIForm_Load() Dim lWnd as Long lWnd = GetWindowLong(Me.hWnd, GWL_STYLE)
'Tira o botão de minimizar lWnd = lWnd And Not (WS_MINIMIZEBOX)
'Tira o botão de maximizar lWnd = lWnd And Not (WS_MAXIMIZEBOX)
lWnd = SetWindowLong(Me.hWnd, GWL_STYLE, lWnd) End Sub
|
|
|
|
|