This property can be set to None, which provides no visual representation Text, which shows only text Image, which displays the item only with an image or ImageAndText, which displays the image next to the text.ĭetermines whether the DoubleClick event will fire.Ĭontains a collection of tool strip items (usually tool strip menu items but not necessarily) that appear in the dropdown list when this item is chosen.ĭetermines whether the tool strip menu item is enabled. The CheckState can be Checked, Unchecked, or Indeterminate.ĭetermines how the tool strip menu item is displayed. Table 4-6 Important Properties of the ToolStripMenuItem Controlĭetermines whether the menu item is automatically sized to fit the text.ĭetermines whether the menu item appears as checked.ĭetermines whether the menu item is automatically checked when clicked. Table 4-6 explains some of the important properties of the ToolStripMenuItem control. ToolStripMenuItems provide all of the functionality that is expected of menus. Because MenuStrip derives from ToolStrip, it exposes most of the same properties as the ToolStrip control and encapsulates most of the same functionality. Note that the properties of the MenuStrip control are very similar to the properties of the ToolStrip control. Indicates the direction of the text in controls hosted in the tool strip. When hosted in a ToolStripContainer, it indicates whether the tool strip will stretch to the full length of the ToolStripPanel. Indicates whether tooltips for individual tool strip items are displayed. System uses system settings, Professional indicates a Microsoft Office-style appearance, and ManagerRenderMode gets the setting automatically. Flow allows the items to stack horizontally or vertically as needed, and Table arranges all of the items flush left.ĭetermines how the tool strip items are rendered. StackWithOverflow determines the stack model appropriate to the Dock property of the tool strip. Vertical-StackWithOverFlow stacks items vertically and overflows as needed. A value of HorizontalStackWithOverFlow indicates that items are stacked horizontally and overflow as needed. Indicates how the controls on the tool strip are laid out. Although Menu-Strip controls can be free in the form, they are most commonly docked to one of the form edges. Indicates whether this menu strip can be merged with another tool strip. Table 4-5 Important Properties of the MenuStrip Control When set to True, contained items can be reordered when the user holds down the Alt key and grabs the item with the mouse. Table 4-5 Important Properties of the MenuStrip ControlĪllowItemReorder Indicates whether items can be reordered by the user. Important properties of the MenuStrip control are shown in Table 4-5. The menu strip exposes many properties that affect the behavior of its hosted ToolStripMenuItems. Each ToolStripMenuItem can contain its own set of menu items, allowing for the creation of nested menus. They can appear as text, an image, or both, and can execute code found in their ToolStripMenuItem.Click event handlers when clicked. ToolStripMenuItems are the controls that provide the visual representation for items on a menu. Its primary function, however, is to host ToolStripMenuItems. The MenuStrip control derives from ToolStrip and can host all of the tool strip items described in the previous lesson. When creating a menu, if an item named "Help" is listed, it should be at the far right and the H should have keyboard access.The MenuStrip control is essentially a ToolStrip control that is optimized for the display of ToolStripMenuItems. If you click on an item in a menu that is grayed out, you will toggle it on, and it will appear in black textīy default, all new menu items have their Enabled property set to TrueĪn enabled menu item appears in black text and is available for selection. When creating menus with the MenuStrip component, the Name property is used to hold the words that will appear on the screen in the menu bar.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |