Menu Strip ShowItemToolTip

G

Guest

How often do you disagree with the design decisions that the Framework
developers made? (Don't answer; that's a rhetorical question.)

In this case I disagree with one but offer up the solution I found.

IMHO if you set ShowItemToolTip to false for a menustip, its value should
recurse to the sub menus. But it doesn't. So here's the work around:

Private Sub gooseMenu(ByVal items As ToolStripItemCollection, ByVal dtt
As Boolean)
For Each msi As ToolStripItem In items
Dim mi As ToolStripMenuItem = TryCast(msi, ToolStripMenuItem)
If mi Is Nothing Then Continue For
Dim dd As ToolStripDropDown = mi.DropDown
dd.ShowItemToolTips = dtt
If mi.DropDownItems.Count > 0 Then gooseMenu(mi.DropDownItems,
dtt)
Next
End Sub
Private Sub gooseOptions()
Dim dtt As Boolean = My.Settings.DisplayToolTips
Me.ToolTip1.Active = dtt
Me.MainMenuStrip.ShowItemToolTips = dtt
gooseMenu(Me.MainMenuStrip.Items, dtt)
End Sub

Better Ideas will cheerfully entertained. RTFM will also be done, if you
provide the link.

--
Regards,
Al Christoph
Senior Consultant
Three Bears Software, LLC
just right software @ just right prices @ 3bears.biz
Microsoft Certified Partner (ISV)
Coming soon: Windows Mail for Vista.
 
Joined
Jan 25, 2012
Messages
1
Reaction score
0
Hi there,

It's strange that this post helped me to figure out whats going on with ShowItemToolTips property in the related .NET class after "6" years of this post's been posted. This post helped me to understand what's going on actually. So I've written my solution (that I'm working with C#), which, I believe, is a better/shorter solution. Here we go:


I've put this into the _Load() event of the related Form.

Code:
this.menuStrip.ShowItemToolTips = false;
foreach (ToolStripMenuItem ti in this.menuStrip.Items)
{
    ti.DropDown.ShowItemToolTips = false;
}

There we now have disabled all annoying ToolTips popping up where actually we have StatusStrip to cover its job.. :)

Oh I almost forgot: Thanks to the original author.


Kaan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top