Forum Clubic

Comment désactiver ce bouton sous vb - desactivez le bouton agrandir

svp je ne sait pas comment desactiver le bouton agrandir de la fenêtre de mon application.aider moi svp.

NB: je parle des boutons qui permetttent de reduire,agrandir,fermer

vb quoi ?

'-- Déclarations
Private Const GWL_STYLE As Long = -16

Private Const WS_MAXIMIZEBOX = &H10000
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_SYSMENU = &H80000

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

'Pour désactiver les boutons :
Private Sub Form_Load()
SetWindowLong hwnd, GWL_STYLE, GetWindowLong(Me.hwnd, GWL_STYLE) Xor WS_MAXIMIZEBOX
SetWindowLong hwnd, GWL_STYLE, GetWindowLong(Me.hwnd, GWL_STYLE) Xor WS_MINIMIZEBOX
End Sub

Remarque:
Valable uniquement à la création de la Form, dans la procédure Form_Load.