Remove selection from a Strip Menu

Asked

Viewed 78 times

1

I got the following Menu Strip:

inserir a descrição da imagem aqui

I would like when I move the mouse over it not to have the color blue. It’s just to be informative this and not to use as buttons.

Using enable the Menu Strip turns gray and loses all sense of my using it.

  • I don’t know if you can understand the publication. You want a strip that is only informative?

  • That’s right, I think it’s stupid of me, but I used it that way because I didn’t know how to perform a previous procedure, so I did it with Menu Strip

2 answers

1

This is the expected behavior of a menu. Swap the component for a ToolStrip and add a label.

inserir a descrição da imagem aqui

1


My guess is you’re looking for class ToolStripLabel which is just a Label that can be used in conjunction with a Menustrip.

Toollabel is descended from ToolStripItem so can be added to the collection MenuStrip.Items.

To use it just add one ToolStripLabel the collection MenuStrip.Items:

menuStrip1.Items.Add(new ToolStripLabel("PT Stack Overflow"));

To add it as sub-item from another ToolStripMenuItem use the property ToolStripMenuItem.DropDownItems of the item in which you want to add it:

ToolStripLabel MenuLabel1 = new ToolStripLabel("PT Stack Overflow");
((ToolStripMenuItem)menuStrip1.Items[0]).DropDownItems.Add(MenuLabel1);
  • 1

    thanks for the help, hug :D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.