ToolStripItem

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
Exam Prep. Guides
70-505 Study Guide
70-526 Study Guide

1. Forms Controls

2. Integrating Data
3. Printing/Reporting
4. Enhancing Usability
5. Asynchronous Prog.
6. Forms Controls
7. Configure/Deploy

edit
Exam 70-526 Preparation Guide: Create and configure menus.


Contents


A ToolStripItem is an element such as a button, combo box, text box, or label that can be contained in a ToolStrip control or a ToolStripDropDown control.

The ToolStripItem class is an abstract class that manages events and layout for all of the elements that a ToolStrip or ToolStripDropDown can contain.

ToolStripItem controls must be contained in a ToolStrip, MenuStrip, StatusStrip, or ContextMenuStrip and cannot be added directly to a form.

Inheritance hierarchy

System.Object 
  System.MarshalByRefObject 
    System.ComponentModel.Component 
      System.Windows.Forms.ToolStripItem (abstract)
        System.Windows.Forms.ToolStripButton 
        System.Windows.Forms.ToolStripControlHost (abstract)
          System.Windows.Forms.ToolStripComboBox
          System.Windows.Forms.ToolStripProgressBar
          System.Windows.Forms.ToolStripTextBox
        System.Windows.Forms.ToolStripDropDownItem (abstract)
          System.Windows.Forms.ToolStripDropDownButton
            System.Windows.Forms.ToolStripOverflowButton
          System.Windows.Forms.ToolStripMenuItem
          System.Windows.Forms.ToolStripSplitButton
            System.Windows.Forms.ToolStripColorButton
        System.Windows.Forms.ToolStripLabel 
          System.Windows.Forms.ToolStripStatusLabel
        System.Windows.Forms.ToolStripSeparator


Useful properties

  • Image - Gets or sets the image that is displayed on a ToolStripItem.
  • ImageAlign - Gets or sets the alignment of the image on a ToolStripItem.
  • ImageIndex - Gets or sets the index value of the image that is displayed on the item.
  • ImageKey - Gets or sets the key accessor for the image in the ImageList that is displayed on a ToolStripItem.
  • ImageScaling - Indicaties whether an image on a ToolStripItem is automatically resized to fit in a container.
  • ImageTransparentColor - Gets or sets the color to treat as transparent in a ToolStripItem image.
  • Text - Gets or sets the text that is to be displayed on the item.
  • TextAlign - Gets or sets the alignment of the text on a ToolStripLabel.
  • TextDirection - Gets the orientation of text used on a ToolStripItem.
  • TextImageRelation - Gets or sets the position of ToolStripItem text and image relative to each other.
  • ToolTipText - Gets or sets the text that appears as a ToolTip for a control.


Useful methods

  • GetCurrentParent - Retrieves the ToolStrip that is the container of the current ToolStripItem.


Other resources

Tool, Menu, and Status Strips—The ToolStripItem


MSDN resources

  • ToolStripButton - Provides a typical pushbutton which supports both text and images.
  • ToolStripControlHost - A control that acts as a host for customized implementations or any other Windows Form controls.
  • ToolStripProgressBar - A specialized progress bar implementation for use within a StatusStrip control.
  • ToolStripDropDownButton - This control provides a button which, if clicked, displays a ToolStripDropDown control.
  • ToolStripMenuItem - A special menu control built specifically for use with the MenuStrip and ContextMenuStrip controls.
  • ToolStripSplitButton - A combination of normal button and a DropDownButton. With has an arrow down button for a DropDownList of buttons.
  • ToolStripLabel - Used to display normal text, hyperlinks, and images.


Previous_Page_.gif Next_Page_.gif
© 2007-2008 Mike Kitchen



Personal tools