ToolStripItem Class
Represents the abstract base class that manages events and layout for all the elements that a ToolStrip or ToolStripDropDown can contain.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
System::MarshalByRefObject
System.ComponentModel::Component
System.Windows.Forms::ToolStripItem
System.Windows.Forms::ToolStripButton
System.Windows.Forms::ToolStripControlHost
System.Windows.Forms::ToolStripDropDownItem
System.Windows.Forms::ToolStripLabel
System.Windows.Forms::ToolStripSeparator
| Name | Description | |
|---|---|---|
![]() | ToolStripItem() | Initializes a new instance of the ToolStripItem class. |
![]() | ToolStripItem(String^, Image^, EventHandler^) | Initializes a new instance of the ToolStripItem class with the specified name, image, and event handler. |
![]() | ToolStripItem(String^, Image^, EventHandler^, String^) | Initializes a new instance of the ToolStripItem class with the specified display text, image, event handler, and name. |
| Name | Description | |
|---|---|---|
![]() | AccessibilityObject | Gets the AccessibleObject assigned to the control. |
![]() | AccessibleDefaultActionDescription | Gets or sets the default action description of the control for use by accessibility client applications. |
![]() | AccessibleDescription | Gets or sets the description that will be reported to accessibility client applications. |
![]() | AccessibleName | Gets or sets the name of the control for use by accessibility client applications. |
![]() | AccessibleRole | Gets or sets the accessible role of the control, which specifies the type of user interface element of the control. |
![]() | Alignment | Gets or sets a value indicating whether the item aligns towards the beginning or end of the ToolStrip. |
![]() | AllowDrop | Gets or sets a value indicating whether drag-and-drop and item reordering are handled through events that you implement. |
![]() | Anchor | Gets or sets the edges of the container to which a ToolStripItem is bound and determines how a ToolStripItem is resized with its parent. |
![]() | AutoSize | Gets or sets a value indicating whether the item is automatically sized. |
![]() | AutoToolTip | Gets or sets a value indicating whether to use the Text property or the ToolTipText property for the ToolStripItem ToolTip. |
![]() | Available | Gets or sets a value indicating whether the ToolStripItem should be placed on a ToolStrip. |
![]() | BackColor | Gets or sets the background color for the item. |
![]() | BackgroundImage | Gets or sets the background image displayed in the item. |
![]() | BackgroundImageLayout | Gets or sets the background image layout used for the ToolStripItem. |
![]() | Bounds | Gets the size and location of the item. |
![]() | CanRaiseEvents | Gets a value indicating whether the component can raise an event.(Inherited from Component.) |
![]() | CanSelect | Gets a value indicating whether the item can be selected. |
![]() | Container | Gets the IContainer that contains the Component.(Inherited from Component.) |
![]() | ContentRectangle | Gets the area where content, such as text and icons, can be placed within a ToolStripItem without overwriting background borders. |
![]() | DefaultAutoToolTip | Gets a value indicating whether to display the ToolTip that is defined as the default. |
![]() | DefaultDisplayStyle | Gets a value indicating what is displayed on the ToolStripItem. |
![]() | DefaultMargin | Gets the default margin of an item. |
![]() | DefaultPadding | Gets the internal spacing characteristics of the item. |
![]() | DefaultSize | Gets the default size of the item. |
![]() | DesignMode | |
![]() | DismissWhenClicked | Gets a value indicating whether items on a ToolStripDropDown are hidden after they are clicked. |
![]() | DisplayStyle | Gets or sets whether text and images are displayed on a ToolStripItem. |
![]() | Dock | Gets or sets which ToolStripItem borders are docked to its parent control and determines how a ToolStripItem is resized with its parent. |
![]() | DoubleClickEnabled | Gets or sets a value indicating whether the ToolStripItem can be activated by double-clicking the mouse. |
![]() | Enabled | Gets or sets a value indicating whether the parent control of the ToolStripItem is enabled. |
![]() | Events | |
![]() | Font | Gets or sets the font of the text displayed by the item. |
![]() | ForeColor | Gets or sets the foreground color of the item. |
![]() | Height | Gets or sets the height, in pixels, of a ToolStripItem. |
![]() | 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 | Gets or sets a value indicating 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. |
![]() | IsDisposed | Gets a value indicating whether the object has been disposed of. |
![]() | IsOnDropDown | Gets a value indicating whether the container of the current Control is a ToolStripDropDown. |
![]() | IsOnOverflow | |
![]() | Margin | Gets or sets the space between the item and adjacent items. |
![]() | MergeAction | Gets or sets how child menus are merged with parent menus. |
![]() | MergeIndex | Gets or sets the position of a merged item within the current ToolStrip. |
![]() | Name | Gets or sets the name of the item. |
![]() | Overflow | Gets or sets whether the item is attached to the ToolStrip or ToolStripOverflowButton or can float between the two. |
![]() | Owner | Gets or sets the owner of this item. |
![]() | OwnerItem | Gets the parent ToolStripItem of this ToolStripItem. |
![]() | Padding | Gets or sets the internal spacing, in pixels, between the item's contents and its edges. |
![]() | Parent | Gets or sets the parent container of the ToolStripItem. |
![]() | Placement | Gets the current layout of the item. |
![]() | Pressed | Gets a value indicating whether the state of the item is pressed. |
![]() | RightToLeft | Gets or sets a value indicating whether items are to be placed from right to left and text is to be written from right to left. |
![]() | RightToLeftAutoMirrorImage | Mirrors automatically the ToolStripItem image when the RightToLeft property is set to Yes. |
![]() | Selected | Gets a value indicating whether the item is selected. |
![]() | ShowKeyboardCues | Gets a value indicating whether to show or hide shortcut keys. |
![]() | Site | |
![]() | Size | Gets or sets the size of the item. |
![]() | Tag | Gets or sets the object that contains data about the item. |
![]() | 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. |
![]() | Visible | Gets or sets a value indicating whether the item is displayed. |
![]() | Width | Gets or sets the width in pixels of a ToolStripItem. |
| Name | Description | |
|---|---|---|
![]() | CreateAccessibilityInstance() | Creates a new accessibility object for the ToolStripItem. |
![]() | CreateObjRef(Type^) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.) |
![]() | Dispose() | |
![]() | Dispose(Boolean) | Releases the unmanaged resources used by the ToolStripItem and optionally releases the managed resources.(Overrides Component::Dispose(Boolean).) |
![]() | DoDragDrop(Object^, DragDropEffects) | Begins a drag-and-drop operation. |
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | |
![]() | GetCurrentParent() | Retrieves the ToolStrip that is the container of the current ToolStripItem. |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetLifetimeService() | Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.) |
![]() | GetPreferredSize(Size) | Retrieves the size of a rectangular area into which a control can be fit. |
![]() | GetService(Type^) | |
![]() | GetType() | |
![]() | InitializeLifetimeService() | Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.) |
![]() | Invalidate() | Invalidates the entire surface of the ToolStripItem and causes it to be redrawn. |
![]() | Invalidate(Rectangle) | Invalidates the specified region of the ToolStripItem by adding it to the update region of the ToolStripItem, which is the area that will be repainted at the next paint operation, and causes a paint message to be sent to the ToolStripItem. |
![]() | IsInputChar(Char) | Determines whether a character is an input character that the item recognizes. |
![]() | IsInputKey(Keys) | Determines whether the specified key is a regular input key or a special key that requires preprocessing. |
![]() | MemberwiseClone() | |
![]() | MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object.(Inherited from MarshalByRefObject.) |
![]() | OnAvailableChanged(EventArgs^) | Raises the AvailableChanged event. |
![]() | OnBackColorChanged(EventArgs^) | Raises the BackColorChanged event. |
![]() | OnBoundsChanged() | Occurs when the Bounds property changes. |
![]() | OnClick(EventArgs^) | Raises the Click event. |
![]() | OnDisplayStyleChanged(EventArgs^) | Raises the DisplayStyleChanged event. |
![]() | OnDoubleClick(EventArgs^) | Raises the DoubleClick event. |
![]() | OnDragDrop(DragEventArgs^) | Raises the DragDrop event. |
![]() | OnDragEnter(DragEventArgs^) | Raises the DragEnter event. |
![]() | OnDragLeave(EventArgs^) | Raises the DragLeave event. |
![]() | OnDragOver(DragEventArgs^) | Raises the DragOver event. |
![]() | OnEnabledChanged(EventArgs^) | Raises the EnabledChanged event. |
![]() | OnFontChanged(EventArgs^) | Raises the FontChanged event. |
![]() | OnForeColorChanged(EventArgs^) | Raises the ForeColorChanged event. |
![]() | OnGiveFeedback(GiveFeedbackEventArgs^) | Raises the GiveFeedback event. |
![]() | OnLayout(LayoutEventArgs^) | Raises the Layout event. |
![]() | OnLocationChanged(EventArgs^) | Raises the LocationChanged event. |
![]() | OnMouseDown(MouseEventArgs^) | Raises the MouseDown event. |
![]() | OnMouseEnter(EventArgs^) | Raises the MouseEnter event. |
![]() | OnMouseHover(EventArgs^) | Raises the MouseHover event. |
![]() | OnMouseLeave(EventArgs^) | Raises the MouseLeave event. |
![]() | OnMouseMove(MouseEventArgs^) | Raises the MouseMove event. |
![]() | OnMouseUp(MouseEventArgs^) | Raises the MouseUp event. |
![]() | OnOwnerChanged(EventArgs^) | Raises the OwnerChanged event. |
![]() | OnOwnerFontChanged(EventArgs^) | Raises the FontChanged event when the Font property has changed on the parent of the ToolStripItem. |
![]() | OnPaint(PaintEventArgs^) | Raises the Paint event. |
![]() | OnParentBackColorChanged(EventArgs^) | Raises the BackColorChanged event. |
![]() | OnParentChanged(ToolStrip^, ToolStrip^) | Raises the ParentChanged event. |
![]() | OnParentEnabledChanged(EventArgs^) | Raises the EnabledChanged event when the Enabled property value of the item's container changes. |
![]() | OnParentForeColorChanged(EventArgs^) | Raises the ForeColorChanged event. |
![]() | OnParentRightToLeftChanged(EventArgs^) | Raises the RightToLeftChanged event. |
![]() | OnQueryContinueDrag(QueryContinueDragEventArgs^) | Raises the QueryContinueDrag event. |
![]() | OnRightToLeftChanged(EventArgs^) | Raises the RightToLeftChanged event. |
![]() | OnTextChanged(EventArgs^) | Raises the TextChanged event. |
![]() | OnVisibleChanged(EventArgs^) | Raises the VisibleChanged event. |
![]() | PerformClick() | Generates a Click event for a ToolStripItem. |
![]() | ProcessCmdKey(Message%, Keys) | Processes a command key. |
![]() | ProcessDialogKey(Keys) | Processes a dialog key. |
![]() | ProcessMnemonic(Char) | Processes a mnemonic character. |
![]() | ResetBackColor() | This API supports the product infrastructure and is not intended to be used directly from your code. This method is not relevant to this class. |
![]() | ResetDisplayStyle() | This API supports the product infrastructure and is not intended to be used directly from your code. This method is not relevant to this class. |
![]() | ResetFont() | This API supports the product infrastructure and is not intended to be used directly from your code. This method is not relevant to this class. |
![]() | ResetForeColor() | This API supports the product infrastructure and is not intended to be used directly from your code. This method is not relevant to this class. |
![]() | ResetImage() | This API supports the product infrastructure and is not intended to be used directly from your code. This method is not relevant to this class. |
![]() | ResetMargin() | This API supports the product infrastructure and is not intended to be used directly from your code. This method is not relevant to this class. |
![]() | ResetPadding() | This API supports the product infrastructure and is not intended to be used directly from your code. This method is not relevant to this class. |
![]() | ResetRightToLeft() | This API supports the product infrastructure and is not intended to be used directly from your code. This method is not relevant to this class. |
![]() | ResetTextDirection() | This API supports the product infrastructure and is not intended to be used directly from your code. This method is not relevant to this class. |
![]() | Select() | Selects the item. |
![]() | SetBounds(Rectangle) | Sets the size and location of the item. |
![]() | SetVisibleCore(Boolean) | Sets the ToolStripItem to the specified visible state. |
![]() | ToString() | Returns a String containing the name of the Component, if any. This method should not be overridden.(Overrides Component::ToString().) |
| Name | Description | |
|---|---|---|
![]() | AvailableChanged | Occurs when the value of the Available property changes. |
![]() | BackColorChanged | Occurs when the value of the BackColor property changes. |
![]() | Click | Occurs when the ToolStripItem is clicked. |
![]() | DisplayStyleChanged | Occurs when the DisplayStyle has changed. |
![]() | Disposed | |
![]() | DoubleClick | Occurs when the item is double-clicked with the mouse. |
![]() | DragDrop | Occurs when the user drags an item and the user releases the mouse button, indicating that the item should be dropped into this item. |
![]() | DragEnter | Occurs when the user drags an item into the client area of this item. |
![]() | DragLeave | Occurs when the user drags an item and the mouse pointer is no longer over the client area of this item. |
![]() | DragOver | Occurs when the user drags an item over the client area of this item. |
![]() | EnabledChanged | Occurs when the Enabled property value has changed. |
![]() | ForeColorChanged | Occurs when the ForeColor property value changes. |
![]() | GiveFeedback | Occurs during a drag operation. |
![]() | LocationChanged | Occurs when the location of a ToolStripItem is updated. |
![]() | MouseDown | Occurs when the mouse pointer is over the item and a mouse button is pressed. |
![]() | MouseEnter | Occurs when the mouse pointer enters the item. |
![]() | MouseHover | Occurs when the mouse pointer hovers over the item. |
![]() | MouseLeave | Occurs when the mouse pointer leaves the item. |
![]() | MouseMove | Occurs when the mouse pointer is moved over the item. |
![]() | MouseUp | Occurs when the mouse pointer is over the item and a mouse button is released. |
![]() | OwnerChanged | Occurs when the Owner property changes. |
![]() | Paint | Occurs when the item is redrawn. |
![]() | QueryAccessibilityHelp | Occurs when an accessibility client application invokes help for the ToolStripItem. |
![]() | QueryContinueDrag | Occurs during a drag-and-drop operation and allows the drag source to determine whether the drag-and-drop operation should be canceled. |
![]() | RightToLeftChanged | Occurs when the RightToLeft property value changes. |
![]() | TextChanged | Occurs when the value of the Text property changes. |
![]() | VisibleChanged | Occurs when the value of the Visible property changes. |
| Name | Description | |
|---|---|---|
![]() ![]() | IDropTarget::OnDragDrop(DragEventArgs^) | Raises the DragDrop event. |
![]() ![]() | IDropTarget::OnDragEnter(DragEventArgs^) | Raises the DragEnter event. |
![]() ![]() | IDropTarget::OnDragLeave(EventArgs^) | Raises the DragLeave event. |
![]() ![]() | IDropTarget::OnDragOver(DragEventArgs^) | Raises the DragOver event. |
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, which is similar to a Windows shortcut menu. The ToolStrip class manages the painting and keyboard and mouse input, including drag-and-drop input, for these elements, and the ToolStripItem class manages events and layout within the elements themselves.
ToolStripItem classes either inherit directly from ToolStripItem, or they inherit indirectly from ToolStripItem through ToolStripControlHost or ToolStripDropDownItem.
ToolStripItem controls must be contained in a ToolStrip, MenuStrip, StatusStrip, or ContextMenuStrip and cannot be added directly to a form. The various container classes are designed to contain an appropriate subset of ToolStripItem controls.
Note A given ToolStripItem cannot have more than one parent ToolStrip. You must copy of the ToolStripItem and add it to other ToolStrip controls.
The following table shows the elements that derive from the ToolStripItem class and which therefore can be hosted in a ToolStrip or ToolStripDropDown.
Element | Description |
|---|---|
A toolbar button that supports images and text. | |
A text label typically used in a status bar or ToolStrip as a comment or title. | |
A non-selectable space or space with a vertical bar that visually groups elements. | |
A ToolStripItem that hosts a ToolStripComboBox, ToolStripTextBox, ToolStripProgressBar, other Windows Forms controls, or custom controls. A ToolStripComboBox is a text box in which the user can enter text, along with a list from which the user can select text to fill the text box. A ToolStripTextBox enables the user to enter text. A ToolStripProgressBar represents a Windows progress bar control contained in a StatusStrip. | |
A ToolStripItem that hosts a ToolStripMenuItem, ToolStripSplitButton, and ToolStripDropDownButton. A ToolStripMenuItem is a selectable option displayed on a menu or context menu. A ToolStripSplitButton is a combination of a regular button and a drop-down button. A ToolStripDropDownButton is a button that supports drop-down functionality. | |
A panel in a StatusStrip control. |
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.






