Results 1 to 13 of 13

Thread: not showing the icon and showing the disable X in the corner

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    how do I only show the X disabled in the top right corner, no Max or Min, and also no Icon?
    NXSupport - Your one-stop source for computer help

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

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    thanks
    NXSupport - Your one-stop source for computer help

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

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    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
    NXSupport - Your one-stop source for computer help

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

  7. #7
    Guest
    Great I'll give it a shot thanks a bunch!

  8. #8
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    if you set icon to (none), the icon is replaced by a windows icon (at least it was on mine?)

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    smae thing happened to me, but I'm OK with it
    NXSupport - Your one-stop source for computer help

  10. #10
    Guest
    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?)
    Did you remember to change your borderstyle to FixedSingle or FixedDialog?

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    I had it set ot a single, now I changed it to a FixDialog, and it doesn't show the icon
    NXSupport - Your one-stop source for computer help

  12. #12
    Guest
    Isn't that what you wanted?

  13. #13

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    yea it is, I'm just saying that if you set it to single it will still show the icon
    NXSupport - Your one-stop source for computer help

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