Is there a way to put an icon next to the text in a MenuItem?
I use the following code to display a popup menu when the user right clicks in a user control:
ContextMenu menu = new ContextMenu();
MenuItem item = new MenuItem("test", OnClick);
menu.MenuItems.Add(item);
menu.Show(this, this.PointToClient(MousePosition));
I would like to put a icon to the left of the "test" string in the popup menu so that the user more easily recognizes it. Is there a way to do this other than by setting the OwnerDraw property to true (thus requiring me to completely draw the menu item myself, like it is done in this example: http://www.codeproject.com/KB/menus/cs_menus.aspx)?
Any help is appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…