Otiel
Otiel

Reputation: 18743

Check mark and image next to mainMenu item

I would like to be able to display an image and a check mark next to a menu item in a mainMenu. Currently, it's either an image or a check mark, but I'm afraid both at the same time are not possible.

Image

If I add menuItemOption1.Checked = true;, the item is checked but the image is not displayed anymore:

Check mark

I didn't find any other way to show the user that some menu item is checked (can't change the text color), can someone think of any way?

(I would like to keep the images displayed as my menu items have not-that-obvious names, and the images are a great way for the user to understand the menus.)

Upvotes: 0

Views: 2835

Answers (2)

Otiel
Otiel

Reputation: 18743

I solved this by changing simply the menu texts:

menuItemOption1.Text = "[✓] Option 1";

Upvotes: 3

LarsTech
LarsTech

Reputation: 81675

You can't do it from the designer, but try adding this to your code:

public Form1() {
  InitializeComponent();

  ((ToolStripDropDownMenu)optionsMenu.DropDown).ShowCheckMargin = true;
  ((ToolStripDropDownMenu)optionsMenu.DropDown).ShowImageMargin = true;
}

Upvotes: 1

Related Questions