Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide menu line when creating Popup menu

Status
Not open for further replies.

Kflasph

Programmer
Apr 8, 2002
65
US
I have a program that I created a PopupMenu for so when the user does a right click - there are options they can select.

The question is :
In order to create the PopupMenu, I created a menu for my form and then made parent for the menu options disabled and not visible.
When the form is launched however there is a seperation line where a menu should be.
Is there a way to remove this ?

Thanks in advance,
Kflasph
 
Create another form (that never gets shown) and use that as the host for all your popup menus
 
Let's say I don't want to do that. . . is there any other way to remove the line ?

Kflasph
 
Well, theoretically you shouldn't be getting that line unless there is a menu item there. Um ... grasping at straws here, but are you sure you don't have an extra top-level menu item whose caption is a space?
 
I only have the one menu item with the children under the item - I checked just to make sure ;)

I didn't know if maybe there was something I could set when the form is loading to suppress it.


KFlasph
 
All should be well if you create the Menu as a top level Menu on the Form; leave it Enabled; make it inVisible.
 
As I said, theoretically Kflasph shouldn't be getting that line (enabled or disabled should make no difference)
 
Okay this is probably one of those " You should have said that to begin with ".

My form is a mdi child so when the form is launched, the parent top level menu is displayed at the top of the form. When I added the Popupmenu to the child form, the top level menu disappeared and it is blank where the top level menu items were located when the child form is loaded.
If I remove the Popupmenu, it works as it should and the top level menu items appear.

If I change the settings and my form is not a child of the mdi form, it does not show a line.

So I am guessing that there is no way to suppress it if the form is a mdi child form.

Thanks for your help!
KFlasph
 
You should have said that to begin with ... ;-)

MDI parents always get the menus of the active child form (if the child form has a menu).

So now I revert to my original suggestion.
 
Again ... Thanks so much for the help !

Kflasph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top