Solved

A form w/ a menu but w/out the title bar...

Posted on 1998-06-28
8
137 Views
Last Modified: 2010-05-03
i've made a form that has a menu in it but i don't want the title bar showing.  but because the menu is there, i can't get rid of the title bar.  even though the borderstyle of the form is set to "none", the title bar is still there!!!  how can i get rid of it??  i'm using vb4-32
0
Comment
Question by:llcoolmel
  • 3
  • 2
  • 2
  • +1
8 Comments
 

Author Comment

by:llcoolmel
ID: 1464454
Edited text of question
0
 
LVL 2

Expert Comment

by:ndnet
ID: 1464455
Make the menu a popup. (Right CLick, with sub menus.) Just create a regular menu with the menus you would want as submenus in it. Then use the following code and change the second word in the 3rd line for the name of your menu.

Private Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
      If Button = 2 Then
            PopupMenu mnuFile
      End If
End Sub




0
 

Author Comment

by:llcoolmel
ID: 1464456
i have already tried that and i tried it again...still can't get rid of the title bar.  i have also tried making the menu not visible and popup in the form but the title bar is still there.  
0
 
LVL 6

Accepted Solution

by:
alamo earned 150 total points
ID: 1464457
You have to get rid of the menu on your form... even though your border is set to none, the presence of a menu will cause the menu to be shown (as you've found).

But that doesn't matter: the pop-up menu doesn't need to be in the same form. Here's the procedure:

Your main form is Form1. Create it with no menu and no border.
Create Form2 with a single menu item (named mnuFile, for example) and place the menu items you want in your pop-up menu as submenu items.

In Form1 add the popup menu as follows (a slight mdification of what's shown in the Help Example)

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then
        PopupMenu Form2.mnuFile
    End If
End Sub

Notice that instead of "PopupMenu mnuFile" it's "PopupMenu Form2.mnuFile". Now Form1 will have no title bar but will have a popup menu.

If you want your menu items to activate Subs inside Form1 (if they need access to Private data, for example), then make those Subs Public and make your menu items in Form2 do nothing except call those Subs.

One more thing - you must put "Unload Form2" in your Form1_Unload sub, so that the app shuts down properly.

Hope this does what you need, good luck!
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:llcoolmel
ID: 1464458
"...i love you..."
0
 
LVL 6

Expert Comment

by:alamo
ID: 1464459
LOL, glad I could help!
0
 
LVL 2

Expert Comment

by:ndnet
ID: 1464460
Not to be critical here, but I came up with the idea of a poup menu in the first place.
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1464461
Bought This Question.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now