![]() ToolStripEnhancedMenuItem defines the following additional properties: ToolStripEnhancedMenuItem - Menu item with the RadioButton as the check mark ![]() Additionally to parent classįunctionality it provides options for text scrolling. It acts as MenuItemSeparator with additional ability to display static text.įrom ToolStripEnhancedMenuItem. It inherits all functionality of ToolStripMenuItem and additionally provides the following functional enhancements:Ībility to display RadioButton image in place of CheckBox.Ībility to group items into RadiButtonGroup to ensure that only one item within the group can be selected. Code AnatomyĮnhancedContextMenu library consists of three components: That means that the only thing I needed to change was howĮnhanced ToolStripMenuItem paints itself, what didn't look like a lot of work. Present itself in GUI (extra text for separator, radio button as check mark or scrolling text). Only real difference is how enhanced ToolStripMenuItem should My reasoning for this solution was the following: base ToolStripMenuItem class This article is presenting another approach:Ĭomponents inherited from ToolStripMenuItem class. I used this method few times and found it temperamental and buggy, There are plenty of Internet articles and examples showing how to do it. One way is to use ToolStripControlHost object to wrap any WinForms control as ToolStrip insertable control. ![]() Very often, I needed to add into MenuStrip controls not present on the list.įor example, I wanted to display radio button instead of check box, have descriptive separators and scrollable (marquee) menu items (see animated image below).įortunately, there are ways to enrich set of objects that can be used as items in the ToolStrip. It allows to pick item from drop-down combo box. Simple, usually gray line to separate distinct groups of menu items. You can have:īasic menu element: text you can click on to trigger desired action it can have the following optional elements: image, shortcut and checkbox. As designed by Microsoft, number of menu items you can chose from is short. In my professional life, I have to do a lot of GUI development and MenuStrip, especially ContextMenuStrip is one of WinForms controls I use probably most often.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |