Results 1 to 9 of 9

Thread: Disable min,max, x buttons?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Question

    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....

  2. #2
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    you just set the Control Box to false from the properties window
    NXSupport - Your one-stop source for computer help

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Cool 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....

  4. #4
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    sorry I made a mistake will you ever forgive me LOL!!!
    NXSupport - Your one-stop source for computer help

  5. #5
    Guest
    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

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441
    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....

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441
    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....

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441
    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....

  9. #9
    Hyperactive Member Wak's Avatar
    Join Date
    Nov 2000
    Location
    Brisbane, Queensland
    Posts
    298
    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
  •  



Click Here to Expand Forum to Full Width