Solved

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

Posted on 1998-06-28
8
142 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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
 

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

777 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