Solved

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

Posted on 1998-06-28
8
144 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 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