Potlačení Min a Max tlačítek na MDI formuláři

Postup:
V deklarační části formuláře zapište:

Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16)

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

Na událost MDIForm_Load:

Private Sub MDIForm_Load()

  Dim L as Long

  L = GetWindowLong(Me.hWnd, GWL_STYLE)
  L = L And Not (WS_MINIMIZEBOX)
  L = L And Not (WS_MAXIMIZEBOX)
  L = SetWindowLong(Me.hWnd, GWL_STYLE, L)

End Sub

Zpět

Autor: The Bozena

iReklama.cz - nový reklamní systém
iReklama.cz - nový reklamní systém