Results 1 to 8 of 8

Thread: How to remove the exit-button?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    70

    Question How to remove the exit-button?

    Hello there!

    -I want to remove the whole "upper-bar"( where the minimize-, maximize- and exit-buttons are ) in my program.

    -I`ve removed the maximize and minimize buttons, by setting their property to false in the form, but how do I do this with the last one?

  2. #2
    champgary
    Guest
    make the form's
    border style property to fixed single
    and
    control box = false

    Gary

  3. #3
    New Member
    Join Date
    Jun 2002
    Posts
    9
    Set the ControlBox property of the form to False.

    If you don't want any titlebar at all, set the Caption property to an empty string.

    Hope this helps

  4. #4
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    The Netherlands
    Posts
    403
    You can also remove the Close menu from the system menu
    There are 10 types of people, those who understand binary and those who don't

    http://merlijn.beyonix.net

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    70

    Arrow

    -Hmm, okay - thanks! I`m sitting at school, so I`m not able to try this yet, but will this work when I have menus on my form?

    -I`ve made this Active-X, which makes me able to "put" the program in the tray. To do this I use the PopUp-function when clicking on the icon in the tray. When you do this, a menu appears, and you can select "hide" or "show".

    -To make these menus appear, I had to use the menu-editor on the form, but with "visible" unchecked... The question is :

    is it possible to make the whole titlebar dissapear when I`ve got menus on the form?

  6. #6
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    The Netherlands
    Posts
    403
    To remove the system menu close
    (I did not test this code, just made it with API-viewer and MSDN library. It can contain some mistakes
    VB Code:
    1. Private Declare Function GetSystemMenu Lib "user32" ( _
    2.     ByVal hWnd As Long, ByVal bRevert As Long) As Long
    3. Public Declare Function RemoveMenu Lib "user32" _
    4.     Alias "RemoveMenu" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
    5. Public Const SC_CLOSE = &HF060&
    6. Public Const MF_BYCOMMAND = &H0&
    7.  
    8. Private Sub Form_Load
    9.     DisableXButton
    10. End Sub
    11.  
    12. Private Sub DisableXButton
    13.     RemoveMenu(GetSystemMenu(Form.hwnd,0),SC_CLOSE,MF_BYCOMMAND)
    14. end sub
    15.  
    16. Private Sub EnableXButton
    17.     GetSystemMenu(Form.hwnd,true)
    18. End Sub
    There are 10 types of people, those who understand binary and those who don't

    http://merlijn.beyonix.net

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    70
    Looks interesting! I`m going to check out your code when I get home, thank you!

  8. #8
    Lively Member
    Join Date
    Mar 2002
    Location
    Land of the long white cloud
    Posts
    86
    To remove your menus, make the first entry on each Menu so its Visiblity = False, then call the menus as Popup menus.

    Place a Label at the top of the form and when the user clicks the label Popup the menu.

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