You can apply the same style to multiple ToolStrip objects in the same application by setting the RenderMode to ManagerRenderMode and setting the RenderMode or Renderer property to ToolStripManagerRenderMode that you want or ToolStripRenderer value, respectively.įor examples of rendering, see How to: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms. Setting this property automatically sets the RenderMode. Alternatively, you can set the Renderer directly to any class that inherits from the ToolStripRenderer class. Instead, you can set the RenderMode property to one of the ToolStripRenderMode values other than Custom. To apply a style to a ToolStrip and all the ToolStripItem objects it contains, you do not have to handle the Paint event for each item. With this scheme, you can easily apply styles and themes. ToolStrip classes implement a rendering scheme that is significantly different from other Windows Forms controls. You can also host any other existing or COM control in a ToolStripControlHost.įor an example of control hosting, see How to: Wrap a Windows Forms Control with ToolStripControlHost. The ToolStripControlHost class provides built-in wrappers for ToolStripComboBox, ToolStripTextBox, and ToolStripProgressBar controls. You can also view and change the properties for the control and the control's items. Collection editors let you add, remove, and reorder items that the control contains. In Visual Studio, when you click Edit Items on the task list or right-click the control and select Edit Items in the shortcut menu, the collection editor for the control is displayed. In Visual Studio, clicking the smart tag on a control in the designer displays a task list for convenient access to many frequently used commands. The ToolStrip family of controls provides a rich set of tools and templates for in-place editing and defining the foundation of the user interface so that you can quickly create a working application. The following table shows the ToolStrip classes grouped by technology area. The ToolStrip, MenuStrip, ContextMenuStrip, and StatusStrip controls replace the previous toolbar, menu, shortcut menu, and status bar controls, although those controls are retained for backward compatibility. The base ToolStrip class handles painting, user input, and drag-and-drop events for these controls. Controls that derive from ToolStripItem are listed in the following table. These controls are ToolStripItem containers that inherit common behavior and event handling, extended so that each implementation deals with the behavior that is appropriate for it. ToolStrip is the extensible base class for MenuStrip, ContextMenuStrip, and StatusStrip. Merging of ToolStrip controls using ToolStripPanel. Hosting of ToolStrip, traditional, or custom controls using ToolStripControlHost. Relocation of items to an overflow menu with the CanOverflow property.Ĭompletely configurable control location with the ToolStripContainer, ToolStripPanel, and ToolStripContentPanel. The ToolStrip control and classes offer the following improvements over previous controls:Ī more consistent design-time behavior that contains task lists and item collection editors.Ĭustom rendering with ToolStripManager and ToolStripRenderer.īuilt-in rafting (sharing of horizontal or vertical space within the tool area when docked) with the ToolStripContainer and ToolStripPanel.ĭesign-time and run-time reordering of items with the AllowItemReorder property. With the ToolStrip control and its associated classes, you can create advanced toolbar functionality that has consistent and professional appearance and behavior. The ToolStrip control and its associated classes provide a complete solution for creating toolbars, status bars, and menus. This topic summarizes information about the ToolStrip control and the classes that support its use.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |