"Tool tip" covered by ToolStripItems if they have dropdown items?

Posted by Theis on Stack Overflow See other posts from Stack Overflow or by Theis
Published on 2010-04-07T06:50:37Z Indexed on 2010/04/07 6:53 UTC
Read the original article Hit count: 452

Filed under:
|
|
|
|

In Windows Forms - if the dropdown items of a MenuStrip has tooltips and dropdown items themselves the tooltip will have about a 50% chance of showing up below the ToolStripItems.

What is the workaround?

To repro you can create the MenuStrip in Visual Studio or just add the following code to a form and then try to hover your mouse over the menu items to get a tooltip:

        //Make a menu strip
        MenuStrip menu = new MenuStrip();            
        this.Controls.Add(menu);

        //Add category "File"
        ToolStripMenuItem fileItem = new ToolStripMenuItem("File");
        menu.Items.Add(fileItem);

        //Add items
        for (int i = 0; i < 10; i++)
        {
            ToolStripMenuItem item = new ToolStripMenuItem("item");
            item.ToolTipText = "item tooltip";
            item.DropDownItems.Add("sub item");

            fileItem.DropDownItems.Add(item);
        }

I am using .NET 3.5

© Stack Overflow or respective owner

Related posts about tooltip

Related posts about forms