|
-
Sep 11th, 2000, 03:00 PM
#1
Thread Starter
PowerPoster
I have code which will grey out the x at the top of a MDIForm. Is there away to disable the min and max buttons as well?
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Sep 11th, 2000, 03:02 PM
#2
Frenzied Member
you just set the Control Box to false from the properties window
NXSupport - Your one-stop source for computer help
-
Sep 11th, 2000, 03:16 PM
#3
Thread Starter
PowerPoster
Confused?
There isn't a controlbox property on a MDIform, or am I mistaken?
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Sep 11th, 2000, 03:27 PM
#4
Frenzied Member
sorry I made a mistake will you ever forgive me LOL!!!
NXSupport - Your one-stop source for computer help
-
Sep 11th, 2000, 03:35 PM
#5
You can disable the Min and Max buttons just like you would disable the close button.
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 MDIForm_Load()
RemoveMenu GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION 'Disable Close
RemoveMenu GetSystemMenu(hWnd, 0), 4, MF_BYPOSITION 'Disable Maximize
RemoveMenu GetSystemMenu(hWnd, 0), 3, MF_BYPOSITION 'Disable Minimize
End Sub
-
Sep 11th, 2000, 03:38 PM
#6
Thread Starter
PowerPoster
Dimava:
I wasn't trying to be a smart ass. Thanks anyway.
Megatron:
Thank you once agin for your help.
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Sep 11th, 2000, 03:38 PM
#7
Thread Starter
PowerPoster
Dimava:
I wasn't trying to be a smart ass. Thanks anyway.
Megatron:
Thank you once again for your help.
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Sep 11th, 2000, 03:51 PM
#8
Thread Starter
PowerPoster
Megatron:
The x on the MDIform appears gray (Great) but the min and max button still are enabled. I cpoied the code from your post. What am I doing wrong?
Using VB6 Prof. in Win98
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Jul 18th, 2001, 06:29 AM
#9
Hyperactive Member
Or better yet, clear them all in one call. 
Code:
Private Declare Function DestroyMenu _
Lib "user32" ( _
ByVal hMenu As Long _
) As Long
Private Declare Function GetSystemMenu Lib "User32" (ByVal hWnd As Integer, ByVal bRevert As Integer) As Integer
Private Sub Form_Load
DestroyMenu(GetSystemMenu(me.Hwnd, False))
End sub
question:
What is the function to gray out menu's?
Visual Basic 6.0 Enterprise
Visual C++ 6.0 Professional
Wak 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|