-
I was told that this would be the right forum to post this question so here goes...
I'm looking for a way to have the minimize and maximize buttons appear on the form, but not the close button.
Whether or not the minbutton/maxbutton are enabled on the form, the controlbox property overides them, and since there is no closebutton property, I'm kinda stuck.
Any help appreciated.
Thanks.
-
Use this code from Megatron.
Code:
Private Declare Function GetSystemMenu Lib "User32" (ByVal _
hWnd As Integer, ByVal bRevert As Integer) As Integer
Private Declare Function RemoveMenu Lib "User32" (ByVal _
hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags _
As Integer) As Integer
Const MF_BYPOSITION = &H400
Private Sub Form_Load()
RemoveMenu GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION 'Disable Close
End Sub