Title Bar & Menu

  I set the Form.BorderStyle = 0 to make the form without anything title bar, then I setup a menu for this form. But, the title bar show up again. Can I setup a menu so that there is no title bar. I want to make a popup menu everytime I click the right mouse button, but also I want to have my own design of title bar. Can someone help me ?
LVL 1
quanghocAsked:
Who is Participating?
 
mcriderCommented:
You can not create a form in VB that has no title bar if you set the caption of the form to anything other than ""


Try this:

In a new project, create a form with a couple of menu items, then set the following properties of the form:

    BorderStyle = 0
    Caption = ""
    ControlBox = False
    MaxButton = False
    MinButton = False
   
Run the program.  You will get a form without a titlebar that has menus.


Cheers!
0
 
sivaramyCommented:
If you have a menu you can't remove the titlebar.

Without the menu to rem,ove the title bar

Set the Caption to empty.
Set the Control Box property to False
0
 
fibdevCommented:
Sub Form1_Load()

  Form1.Caption = ""
  Form1.ControlBox = False

End Sub

sivaramy is right, you can also set the menu properties at run time from this same sub procedure.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
quanghocAuthor Commented:
  OK, whatever to do, I also want to have the form caption. How to add to the menu at run-time. Do I have to use any API ?
0
 
mcriderCommented:
To do this, what you have to do is set the Form.BorderStyle = 0, then set the VISIBLE property of all of the topmost level menu items to FALSE.

Then to build your own menubar, you can put labels across the top of your form.  In the MOUSEDOWN Event of the labels, you can then change the color of the label and call POPUPMENU for the menu level you want to display.

Don't forget to change the label color back in the MOUSEUP event of the labels...


Hope this helps!


Cheers!
0
 
quanghocAuthor Commented:
 No, I don't mean that. OK, I tell you again. I just want three things:
 + Menu
 + No Title Bar
 + Has Caption
0
 
fibdevCommented:
Do you mean caption only at the top?  Because you have to show a title bar for that unless you use a lable or an image.  You can set the controlbox property to false so there is no close, max/restore, or min button.  I think we are just having trouble with the spacifics of what you are trying to accomplish.

:)
0
 
vbyuvalCommented:
I didn't get it , No Title Bar and Has
Caption ??? Where do you want the caption to be ???
0
 
quanghocAuthor Commented:
  I think we can do this : No Title Bar but Has Caption if you know some software from Norton Utilities. My purpose is having a yellow tip when my Form at "minimize". I don't want the form shows the title bar at all.
0
 
mcriderCommented:
You need to use windowstate and the form_resize event to accomplish this:

When you minimize your form, set the caption, and when you set the form's state to normal or maximized, set the caption to ""


Cheers!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.