how to add icon to context menu in c# windows form

2019-03-06 06:15发布

问题:

I am having a tree view in which if i right click any node context menu is displayed,Now i want to add icons corresponding to items in the context menu.

回答1:

If you're talking about ContextMenuStrip control, you can do that either it in the designer, by clicking on the item and selecting "Set image...", or programmatically by changing the Image property of the ToolStripMenuItem.