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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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.
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 ?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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!
quanghocAuthor Commented:
 No, I don't mean that. OK, I tell you again. I just want three things:
 + Menu
 + No Title Bar
 + Has Caption
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.

:)
vbyuvalCommented:
I didn't get it , No Title Bar and Has
Caption ??? Where do you want the caption to be ???
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!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
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!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.