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!

MenuStrip tool tip on/off control

Status
Not open for further replies.

Jrhaynes

Technical User
Oct 27, 2006
21
US
I posted this question about a year ago Thread796-1330328 and didn't get any responses. Maybe someone else has ran across it by now. How does one turn tooltips on and off for the MenuStrip drop down items and their sub drop down items?

The following:

MenuStrip1.ShowItemToolTips = False

works only on the top level. I have tried several ways involving cycling through the dropdown items, etc. It seems the only way is the brute force method of setting the tooltiptext property to null then refilling the text again when tool tips are to be shown. The Autotooltip item doesn't seem to have any effect either.

Does anyone know a better way?
 
I haven't tried this...

What if you skip working with the menu, and go straight to the ToolTip object, and turn that off?

-Sometimes the answer to your question is the hack that works
 
That does't work either. In fact that is the way the tooltips on all the other controls on the form are controled except for the ToolBar control which has its own own showtooltips method. The MenuStrip control seems to be similar to the ToolBar control and has its own showitemtooltips method but that seems to be broken.

The ToolBar and MenuStrip don't seem to have a means of assigning the tooltip object to them and that is probably why they are provided with their own on/off controls.
 
I tried the
MenuStrip1.ShowItemToolTips = False
through the properties window and it worked.

You may want to make sure that you are setting it after you create the form that has the Menstrip on it.

Have you tried just a base example with a form1 type situation to make sure your logic is correct and then check to make sure that something else isn't interfering with your code?

-Sometimes the answer to your question is the hack that works
 
I am set up to turn tool tips on and off at run time after the form is displayed. The tooltips will turn on at off for the top level items of the menustrip but not for the dropdown items. Was your success for dropdown items?
 
the drop down items have a ToolTipText field like regular controls. Have tried creating a tooltip object and turning that on and off, to see if it affects the drop down items.

The purpose of the forums (at least IMHO) is to help guide you in the right direction, as opposed to do your work for you.

You should try working with test projects as prototypes to whatever features you are trying to implement.

-Sometimes the answer to your question is the hack that works
 
Of course, I am using a simple form1 with just the menu strip object and a tooltip object to study this issue. Thats the way I have tried to resolve this question for quite some time. Thank you for your advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top