how do I only show the X disabled in the top right corner, no Max or Min, and also no Icon?
Printable View
how do I only show the X disabled in the top right corner, no Max or Min, and also no Icon?
Set the MinButton to False
Set the MaxButton to False
Set the Icon to (None) (By highlighing the icon property and pressing Delete)
Set the BorderStyle to Fixed Dialog
Add the following code to your Form to disable the X.
Code:Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_BYPOSITION = &H400&
Private Sub Form_Load()
RemoveMenu GetSystemMenu(hwnd, 0), 6, MF_BYPOSITION
End Sub
thanks
Hello,
Sorry to bust in on this thread, but is there also away to disable the Maximize button on a MDI form? I have been trying to find a way to do this for some time but with not luck so far!
Best
Make a normal form think that its an mdi parent by this code that I got from megatron:
Code:Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Form_Load()
form1.Show
SetParent form2.hwnd, form1.hwnd
End Sub
This will disable the max button in an mdi form.
Code:Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_BYPOSITION = &H400&
Private Sub MDIForm_Load()
RemoveMenu GetSystemMenu(hWnd, 0), 4, F_BYPOSITION
End Sub
Great I'll give it a shot thanks a bunch!
if you set icon to (none), the icon is replaced by a windows icon (at least it was on mine?)
smae thing happened to me, but I'm OK with it
Did you remember to change your borderstyle to FixedSingle or FixedDialog?Quote:
Originally posted by da_silvy
if you set icon to (none), the icon is replaced by a windows icon (at least it was on mine?)
I had it set ot a single, now I changed it to a FixDialog, and it doesn't show the icon
Isn't that what you wanted?
yea it is, I'm just saying that if you set it to single it will still show the icon