|
-
Jun 19th, 2002, 05:08 AM
#1
Thread Starter
Lively Member
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?
-
Jun 19th, 2002, 05:17 AM
#2
make the form's
border style property to fixed single
and
control box = false
Gary
-
Jun 19th, 2002, 05:19 AM
#3
New Member
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
-
Jun 19th, 2002, 05:24 AM
#4
Hyperactive Member
You can also remove the Close menu from the system menu
-
Jun 19th, 2002, 05:38 AM
#5
Thread Starter
Lively Member
-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?
-
Jun 19th, 2002, 05:46 AM
#6
Hyperactive Member
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:
Private Declare Function GetSystemMenu Lib "user32" ( _
ByVal hWnd As Long, ByVal bRevert As Long) As Long
Public Declare Function RemoveMenu Lib "user32" _
Alias "RemoveMenu" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Const SC_CLOSE = &HF060&
Public Const MF_BYCOMMAND = &H0&
Private Sub Form_Load
DisableXButton
End Sub
Private Sub DisableXButton
RemoveMenu(GetSystemMenu(Form.hwnd,0),SC_CLOSE,MF_BYCOMMAND)
end sub
Private Sub EnableXButton
GetSystemMenu(Form.hwnd,true)
End Sub
-
Jun 19th, 2002, 05:53 AM
#7
Thread Starter
Lively Member
Looks interesting! I`m going to check out your code when I get home, thank you!
-
Jun 19th, 2002, 06:45 AM
#8
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|