Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

ToolStripMenuItem Class

Represents a selectable option displayed on a MenuStrip or ContextMenuStrip. Although ToolStripMenuItem replaces and adds functionality to the MenuItem control of previous versions, MenuItem is retained for both backward compatibility and future use if you choose.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
[ToolStripItemDesignerAvailabilityAttribute(ToolStripItemDesignerAvailability.None|ToolStripItemDesignerAvailability.MenuStrip|ToolStripItemDesignerAvailability.ContextMenuStrip)]
public class ToolStripMenuItem : ToolStripDropDownItem

The ToolStripMenuItem type exposes the following members.

  NameDescription
Public methodToolStripMenuItem()Initializes a new instance of the ToolStripMenuItem class.
Public methodToolStripMenuItem(Image)Initializes a new instance of the ToolStripMenuItem class that displays the specified Image.
Public methodToolStripMenuItem(String)Initializes a new instance of the ToolStripMenuItem class that displays the specified text.
Public methodToolStripMenuItem(String, Image)Initializes a new instance of the ToolStripMenuItem class that displays the specified text and image.
Public methodToolStripMenuItem(String, Image, EventHandler)Initializes a new instance of the ToolStripMenuItem class that displays the specified text and image and that does the specified action when the ToolStripMenuItem is clicked.
Public methodToolStripMenuItem(String, Image, ToolStripItem[])Initializes a new instance of the ToolStripMenuItem class that displays the specified text and image and that contains the specified ToolStripItem collection.
Public methodToolStripMenuItem(String, Image, EventHandler, String)Initializes a new instance of the ToolStripMenuItem class with the specified name that displays the specified text and image that does the specified action when the ToolStripMenuItem is clicked.
Public methodToolStripMenuItem(String, Image, EventHandler, Keys)Initializes a new instance of the ToolStripMenuItem class that displays the specified text and image, does the specified action when the ToolStripMenuItem is clicked, and displays the specified shortcut keys.
Top
  NameDescription
Public propertyAccessibilityObjectGets the AccessibleObject assigned to the control. (Inherited from ToolStripItem.)
Public propertyAccessibleDefaultActionDescriptionGets or sets the default action description of the control for use by accessibility client applications. (Inherited from ToolStripItem.)
Public propertyAccessibleDescriptionGets or sets the description that will be reported to accessibility client applications. (Inherited from ToolStripItem.)
Public propertyAccessibleNameGets or sets the name of the control for use by accessibility client applications. (Inherited from ToolStripItem.)
Public propertyAccessibleRoleGets or sets the accessible role of the control, which specifies the type of user interface element of the control. (Inherited from ToolStripItem.)
Public propertyAlignmentGets or sets a value indicating whether the item aligns towards the beginning or end of the ToolStrip. (Inherited from ToolStripItem.)
Public propertyAllowDropGets or sets a value indicating whether drag-and-drop and item reordering are handled through events that you implement. (Inherited from ToolStripItem.)
Public propertyAnchorGets or sets the edges of the container to which a ToolStripItem is bound and determines how a ToolStripItem is resized with its parent. (Inherited from ToolStripItem.)
Public propertyAutoSizeGets or sets a value indicating whether the item is automatically sized. (Inherited from ToolStripItem.)
Public propertyAutoToolTipGets or sets a value indicating whether to use the Text property or the ToolTipText property for the ToolStripItem ToolTip. (Inherited from ToolStripItem.)
Public propertyAvailableGets or sets a value indicating whether the ToolStripItem should be placed on a ToolStrip. (Inherited from ToolStripItem.)
Public propertyBackColorGets or sets the background color for the item. (Inherited from ToolStripItem.)
Public propertyBackgroundImageGets or sets the background image displayed in the item. (Inherited from ToolStripItem.)
Public propertyBackgroundImageLayoutGets or sets the background image layout used for the ToolStripItem. (Inherited from ToolStripItem.)
Public propertyBoundsGets the size and location of the item. (Inherited from ToolStripItem.)
Protected propertyCanRaiseEventsGets a value indicating whether the component can raise an event. (Inherited from Component.)
Public propertyCanSelectGets a value indicating whether the item can be selected. (Inherited from ToolStripItem.)
Public propertyCheckedGets or sets a value indicating whether the ToolStripMenuItem is checked.
Public propertyCheckOnClickGets or sets a value indicating whether the ToolStripMenuItem should automatically appear checked and unchecked when clicked.
Public propertyCheckStateGets or sets a value indicating whether a ToolStripMenuItem is in the checked, unchecked, or indeterminate state.
Public propertyContainerGets the IContainer that contains the Component. (Inherited from Component.)
Public propertyContentRectangleGets the area where content, such as text and icons, can be placed within a ToolStripItem without overwriting background borders. (Inherited from ToolStripItem.)
Protected propertyDefaultAutoToolTipGets a value indicating whether to display the ToolTip that is defined as the default. (Inherited from ToolStripItem.)
Protected propertyDefaultDisplayStyleGets a value indicating what is displayed on the ToolStripItem. (Inherited from ToolStripItem.)
Protected propertyDefaultMarginGets the spacing between the ToolStripMenuItem and an adjacent item. (Overrides ToolStripItem.DefaultMargin.)
Protected propertyDefaultPaddingGets the internal spacing within the ToolStripMenuItem. (Overrides ToolStripItem.DefaultPadding.)
Protected propertyDefaultSizeGets the default size of the ToolStripMenuItem. (Overrides ToolStripItem.DefaultSize.)
Protected propertyDesignModeGets a value that indicates whether the Component is currently in design mode. (Inherited from Component.)
Protected propertyDismissWhenClickedGets a value indicating whether items on a ToolStripDropDown are hidden after they are clicked. (Inherited from ToolStripItem.)
Public propertyDisplayStyleGets or sets whether text and images are displayed on a ToolStripItem. (Inherited from ToolStripItem.)
Public propertyDockGets or sets which ToolStripItem borders are docked to its parent control and determines how a ToolStripItem is resized with its parent. (Inherited from ToolStripItem.)
Public propertyDoubleClickEnabledGets or sets a value indicating whether the ToolStripItem can be activated by double-clicking the mouse. (Inherited from ToolStripItem.)
Public propertyDropDownGets or sets the ToolStripDropDown that will be displayed when this ToolStripDropDownItem is clicked. (Inherited from ToolStripDropDownItem.)
Public propertyDropDownDirectionGets or sets a value indicating the direction in which the ToolStripDropDownItem emerges from its parent container. (Inherited from ToolStripDropDownItem.)
Public propertyDropDownItemsGets the collection of items in the ToolStripDropDown that is associated with this ToolStripDropDownItem. (Inherited from ToolStripDropDownItem.)
Protected propertyDropDownLocationGets the screen coordinates, in pixels, of the upper-left corner of the ToolStripDropDownItem. (Inherited from ToolStripDropDownItem.)
Public propertyEnabledGets or sets a value indicating whether the control is enabled. (Overrides ToolStripItem.Enabled.)
Protected propertyEventsGets the list of event handlers that are attached to this Component. (Inherited from Component.)
Public propertyFontGets or sets the font of the text displayed by the item. (Inherited from ToolStripItem.)
Public propertyForeColorGets or sets the foreground color of the item. (Inherited from ToolStripItem.)
Public propertyHasDropDownGets or sets a value that indicates whether the DropDown for the ToolStripDropDownItem has been created. (Inherited from ToolStripDropDownItem.)
Public propertyHasDropDownItemsGets a value indicating whether the ToolStripDropDownItem has ToolStripDropDown controls associated with it. (Inherited from ToolStripDropDownItem.)
Public propertyHeightGets or sets the height, in pixels, of a ToolStripItem. (Inherited from ToolStripItem.)
Public propertyImageGets or sets the image that is displayed on a ToolStripItem. (Inherited from ToolStripItem.)
Public propertyImageAlignGets or sets the alignment of the image on a ToolStripItem. (Inherited from ToolStripItem.)
Public propertyImageIndexGets or sets the index value of the image that is displayed on the item. (Inherited from ToolStripItem.)
Public propertyImageKeyGets or sets the key accessor for the image in the ImageList that is displayed on a ToolStripItem. (Inherited from ToolStripItem.)
Public propertyImageScalingGets or sets a value indicating whether an image on a ToolStripItem is automatically resized to fit in a container. (Inherited from ToolStripItem.)
Public propertyImageTransparentColorGets or sets the color to treat as transparent in a ToolStripItem image. (Inherited from ToolStripItem.)
Public propertyIsDisposedGets a value indicating whether the object has been disposed of. (Inherited from ToolStripItem.)
Public propertyIsMdiWindowListEntryGets a value indicating whether the ToolStripMenuItem appears on a multiple document interface (MDI) window list.
Public propertyIsOnDropDownGets a value indicating whether the container of the current Control is a ToolStripDropDown. (Inherited from ToolStripItem.)
Public propertyIsOnOverflowGets a value indicating whether the Placement property is set to Overflow. (Inherited from ToolStripItem.)
Public propertyMarginGets or sets the space between the item and adjacent items. (Inherited from ToolStripItem.)
Public propertyMergeActionGets or sets how child menus are merged with parent menus. (Inherited from ToolStripItem.)
Public propertyMergeIndexGets or sets the position of a merged item within the current ToolStrip. (Inherited from ToolStripItem.)
Public propertyNameGets or sets the name of the item. (Inherited from ToolStripItem.)
Public propertyOverflowGets or sets a value indicating whether the ToolStripMenuItem is attached to the ToolStrip or the ToolStripOverflowButton or whether it can float between the two.
Public propertyOwnerGets or sets the owner of this item. (Inherited from ToolStripItem.)
Public propertyOwnerItemGets the parent ToolStripItem of this ToolStripItem. (Inherited from ToolStripItem.)
Public propertyPaddingGets or sets the internal spacing, in pixels, between the item's contents and its edges. (Inherited from ToolStripItem.)
Protected propertyParentGets or sets the parent container of the ToolStripItem. (Inherited from ToolStripItem.)
Public propertyPlacementGets the current layout of the item. (Inherited from ToolStripItem.)
Public propertyPressedGets a value indicating whether the ToolStripDropDownItem is in the pressed state. (Inherited from ToolStripDropDownItem.)
Public propertyRightToLeftGets 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. (Inherited from ToolStripItem.)
Public propertyRightToLeftAutoMirrorImageMirrors automatically the ToolStripItem image when the RightToLeft property is set to Yes. (Inherited from ToolStripItem.)
Public propertySelectedGets a value indicating whether the item is selected. (Inherited from ToolStripItem.)
Public propertyShortcutKeyDisplayStringGets or sets the shortcut key text.
Public propertyShortcutKeysGets or sets the shortcut keys associated with the ToolStripMenuItem.
Protected propertyShowKeyboardCuesGets a value indicating whether to show or hide shortcut keys. (Inherited from ToolStripItem.)
Public propertyShowShortcutKeysGets or sets a value indicating whether the shortcut keys that are associated with the ToolStripMenuItem are displayed next to the ToolStripMenuItem.
Public propertySiteGets or sets the ISite of the Component. (Inherited from Component.)
Public propertySizeGets or sets the size of the item. (Inherited from ToolStripItem.)
Public propertyTagGets or sets the object that contains data about the item. (Inherited from ToolStripItem.)
Public propertyTextGets or sets the text that is to be displayed on the item. (Inherited from ToolStripItem.)
Public propertyTextAlignGets or sets the alignment of the text on a ToolStripLabel. (Inherited from ToolStripItem.)
Public propertyTextDirectionGets the orientation of text used on a ToolStripItem. (Inherited from ToolStripItem.)
Public propertyTextImageRelationGets or sets the position of ToolStripItem text and image relative to each other. (Inherited from ToolStripItem.)
Public propertyToolTipTextGets or sets the text that appears as a ToolTip for a control. (Inherited from ToolStripItem.)
Public propertyVisibleGets or sets a value indicating whether the item is displayed. (Inherited from ToolStripItem.)
Public propertyWidthGets or sets the width in pixels of a ToolStripItem. (Inherited from ToolStripItem.)
Top
  NameDescription
Protected methodCreateAccessibilityInstanceCreates a new accessibility object for the ToolStripMenuItem. (Overrides ToolStripDropDownItem.CreateAccessibilityInstance().)
Protected methodCreateDefaultDropDownCreates a generic ToolStripDropDown for which events can be defined. (Overrides ToolStripDropDownItem.CreateDefaultDropDown().)
Public methodCreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public methodDispose()Releases all resources used by the Component. (Inherited from Component.)
Protected methodDispose(Boolean)Releases the unmanaged resources used by the ToolStripMenuItem and optionally releases the managed resources. (Overrides ToolStripDropDownItem.Dispose(Boolean).)
Public methodDoDragDropBegins a drag-and-drop operation. (Inherited from ToolStripItem.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeReleases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection. (Inherited from Component.)
Public methodGetCurrentParentRetrieves the ToolStrip that is the container of the current ToolStripItem. (Inherited from ToolStripItem.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public methodGetPreferredSizeRetrieves the size of a rectangular area into which a control can be fit. (Inherited from ToolStripItem.)
Protected methodGetServiceReturns an object that represents a service provided by the Component or by its Container. (Inherited from Component.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodHideDropDownMakes a visible ToolStripDropDown hidden. (Inherited from ToolStripDropDownItem.)
Public methodInitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public methodInvalidate()Invalidates the entire surface of the ToolStripItem and causes it to be redrawn. (Inherited from ToolStripItem.)
Public methodInvalidate(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. (Inherited from ToolStripItem.)
Protected methodIsInputCharDetermines whether a character is an input character that the item recognizes. (Inherited from ToolStripItem.)
Protected methodIsInputKeyDetermines whether the specified key is a regular input key or a special key that requires preprocessing. (Inherited from ToolStripItem.)
Protected methodMemberwiseClone()Creates a shallow copy of the current Object. (Inherited from Object.)
Protected methodMemberwiseClone(Boolean)Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Protected methodOnAvailableChangedRaises the AvailableChanged event. (Inherited from ToolStripItem.)
Protected methodOnBackColorChangedRaises the BackColorChanged event. (Inherited from ToolStripItem.)
Protected methodOnBoundsChangedOccurs when the Bounds property changes. (Inherited from ToolStripDropDownItem.)
Protected methodOnCheckedChangedRaises the CheckedChanged event.
Protected methodOnCheckStateChangedRaises the CheckStateChanged event.
Protected methodOnClickRaises the Click event. (Overrides ToolStripItem.OnClick(EventArgs).)
Protected methodOnDisplayStyleChangedRaises the DisplayStyleChanged event. (Inherited from ToolStripItem.)
Protected methodOnDoubleClickRaises the DoubleClick event. (Inherited from ToolStripItem.)
Protected methodOnDragDropRaises the DragDrop event. (Inherited from ToolStripItem.)
Protected methodOnDragEnterRaises the DragEnter event. (Inherited from ToolStripItem.)
Protected methodOnDragLeaveRaises the DragLeave event. (Inherited from ToolStripItem.)
Protected methodOnDragOverRaises the DragOver event. (Inherited from ToolStripItem.)
Protected methodOnDropDownClosedRaises the DropDownClosed event. (Inherited from ToolStripDropDownItem.)
Protected methodOnDropDownHideRaised in response to the HideDropDown method. (Overrides ToolStripDropDownItem.OnDropDownHide(EventArgs).)
Protected methodOnDropDownItemClickedRaises the DropDownItemClicked event. (Inherited from ToolStripDropDownItem.)
Protected methodOnDropDownOpenedRaises the DropDownOpened event. (Inherited from ToolStripDropDownItem.)
Protected methodOnDropDownShowRaised in response to the ShowDropDown method. (Overrides ToolStripDropDownItem.OnDropDownShow(EventArgs).)
Protected methodOnEnabledChangedRaises the EnabledChanged event. (Inherited from ToolStripItem.)
Protected methodOnFontChangedRaises the FontChanged event. (Overrides ToolStripDropDownItem.OnFontChanged(EventArgs).)
Protected methodOnForeColorChangedRaises the ForeColorChanged event. (Inherited from ToolStripItem.)
Protected methodOnGiveFeedbackRaises the GiveFeedback event. (Inherited from ToolStripItem.)
Protected methodOnLayoutRaises the Layout event. (Inherited from ToolStripItem.)
Protected methodOnLocationChangedRaises the LocationChanged event. (Inherited from ToolStripItem.)
Protected methodOnMouseDownRaises the MouseDown event. (Overrides ToolStripItem.OnMouseDown(MouseEventArgs).)
Protected methodOnMouseEnterRaises the MouseEnter event. (Overrides ToolStripItem.OnMouseEnter(EventArgs).)
Protected methodOnMouseHoverRaises the MouseHover event. (Inherited from ToolStripItem.)
Protected methodOnMouseLeaveRaises the MouseLeave event. (Overrides ToolStripItem.OnMouseLeave(EventArgs).)
Protected methodOnMouseMoveRaises the MouseMove event. (Inherited from ToolStripItem.)
Protected methodOnMouseUpRaises the MouseUp event. (Overrides ToolStripItem.OnMouseUp(MouseEventArgs).)
Protected methodOnOwnerChangedRaises the OwnerChanged event. (Overrides ToolStripItem.OnOwnerChanged(EventArgs).)
Protected methodOnOwnerFontChangedRaises the FontChanged event when the Font property has changed on the parent of the ToolStripItem. (Inherited from ToolStripItem.)
Protected methodOnPaintRaises the Paint event. (Overrides ToolStripItem.OnPaint(PaintEventArgs).)
Protected methodOnParentBackColorChangedRaises the BackColorChanged event. (Inherited from ToolStripItem.)
Protected methodOnParentChangedRaises the ParentChanged event. (Inherited from ToolStripItem.)
Protected methodOnParentEnabledChangedRaises the EnabledChanged event when the Enabled property value of the item's container changes. (Inherited from ToolStripItem.)
Protected methodOnParentForeColorChangedRaises the ForeColorChanged event. (Inherited from ToolStripItem.)
Protected methodOnParentRightToLeftChangedRaises the RightToLeftChanged event. (Inherited from ToolStripItem.)
Protected methodOnQueryContinueDragRaises the QueryContinueDrag event. (Inherited from ToolStripItem.)
Protected methodOnRightToLeftChangedRaises the RightToLeftChanged event. (Inherited from ToolStripDropDownItem.)
Protected methodOnTextChangedRaises the TextChanged event. (Inherited from ToolStripItem.)
Protected methodOnVisibleChangedRaises the VisibleChanged event. (Inherited from ToolStripItem.)
Public methodPerformClickActivates the ToolStripItem when it is clicked with the mouse. (Inherited from ToolStripItem.)
Protected methodProcessCmdKeyProcesses a command key. (Overrides ToolStripDropDownItem.ProcessCmdKey(Message, Keys).)
Protected methodProcessDialogKeyProcesses a dialog key. (Inherited from ToolStripDropDownItem.)
Protected methodProcessMnemonicProcesses a mnemonic character. (Overrides ToolStripItem.ProcessMnemonic(Char).)
Public methodResetBackColorInfrastructure. This method is not relevant to this class. (Inherited from ToolStripItem.)
Public methodResetDisplayStyleInfrastructure. This method is not relevant to this class. (Inherited from ToolStripItem.)
Public methodResetFontInfrastructure. This method is not relevant to this class. (Inherited from ToolStripItem.)
Public methodResetForeColorInfrastructure. This method is not relevant to this class. (Inherited from ToolStripItem.)
Public methodResetImageInfrastructure. This method is not relevant to this class. (Inherited from ToolStripItem.)
Public methodResetMarginInfrastructure. This method is not relevant to this class. (Inherited from ToolStripItem.)
Public methodResetPaddingInfrastructure. This method is not relevant to this class. (Inherited from ToolStripItem.)
Public methodResetRightToLeftInfrastructure. This method is not relevant to this class. (Inherited from ToolStripItem.)
Public methodResetTextDirectionInfrastructure. This method is not relevant to this class. (Inherited from ToolStripItem.)
Public methodSelectSelects the item. (Inherited from ToolStripItem.)
Protected methodSetBoundsSets the size and location of the ToolStripMenuItem. (Overrides ToolStripItem.SetBounds(Rectangle).)
Protected methodSetVisibleCoreSets the ToolStripItem to the specified visible state. (Inherited from ToolStripItem.)
Public methodShowDropDownDisplays the ToolStripDropDownItem control associated with this ToolStripDropDownItem. (Inherited from ToolStripDropDownItem.)
Public methodToStringReturns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from ToolStripItem.)
Top
  NameDescription
Public eventAvailableChangedOccurs when the value of the Available property changes. (Inherited from ToolStripItem.)
Public eventBackColorChangedOccurs when the value of the BackColor property changes. (Inherited from ToolStripItem.)
Public eventCheckedChangedOccurs when the value of the Checked property changes.
Public eventCheckStateChangedOccurs when the value of the CheckState property changes.
Public eventClickOccurs when the ToolStripItem is clicked. (Inherited from ToolStripItem.)
Public eventDisplayStyleChangedOccurs when the DisplayStyle has changed. (Inherited from ToolStripItem.)
Public eventDisposedOccurs when the component is disposed by a call to the Dispose method. (Inherited from Component.)
Public eventDoubleClickOccurs when the item is double-clicked with the mouse. (Inherited from ToolStripItem.)
Public eventDragDropOccurs when the user drags an item and the user releases the mouse button, indicating that the item should be dropped into this item. (Inherited from ToolStripItem.)
Public eventDragEnterOccurs when the user drags an item into the client area of this item. (Inherited from ToolStripItem.)
Public eventDragLeaveOccurs when the user drags an item and the mouse pointer is no longer over the client area of this item. (Inherited from ToolStripItem.)
Public eventDragOverOccurs when the user drags an item over the client area of this item. (Inherited from ToolStripItem.)
Public eventDropDownClosedOccurs when the ToolStripDropDown closes. (Inherited from ToolStripDropDownItem.)
Public eventDropDownItemClickedOccurs when the ToolStripDropDown is clicked. (Inherited from ToolStripDropDownItem.)
Public eventDropDownOpenedOccurs when the ToolStripDropDown has opened. (Inherited from ToolStripDropDownItem.)
Public eventDropDownOpeningOccurs as the ToolStripDropDown is opening. (Inherited from ToolStripDropDownItem.)
Public eventEnabledChangedOccurs when the Enabled property value has changed. (Inherited from ToolStripItem.)
Public eventForeColorChangedOccurs when the ForeColor property value changes. (Inherited from ToolStripItem.)
Public eventGiveFeedbackOccurs during a drag operation. (Inherited from ToolStripItem.)
Public eventLocationChangedOccurs when the location of a ToolStripItem is updated. (Inherited from ToolStripItem.)
Public eventMouseDownOccurs when the mouse pointer is over the item and a mouse button is pressed. (Inherited from ToolStripItem.)
Public eventMouseEnterOccurs when the mouse pointer enters the item. (Inherited from ToolStripItem.)
Public eventMouseHoverOccurs when the mouse pointer hovers over the item. (Inherited from ToolStripItem.)
Public eventMouseLeaveOccurs when the mouse pointer leaves the item. (Inherited from ToolStripItem.)
Public eventMouseMoveOccurs when the mouse pointer is moved over the item. (Inherited from ToolStripItem.)
Public eventMouseUpOccurs when the mouse pointer is over the item and a mouse button is released. (Inherited from ToolStripItem.)
Public eventOwnerChangedOccurs when the Owner property changes. (Inherited from ToolStripItem.)
Public eventPaintOccurs when the item is redrawn. (Inherited from ToolStripItem.)
Public eventQueryAccessibilityHelpOccurs when an accessibility client application invokes help for the ToolStripItem. (Inherited from ToolStripItem.)
Public eventQueryContinueDragOccurs during a drag-and-drop operation and allows the drag source to determine whether the drag-and-drop operation should be canceled. (Inherited from ToolStripItem.)
Public eventRightToLeftChangedOccurs when the RightToLeft property value changes. (Inherited from ToolStripItem.)
Public eventTextChangedOccurs when the value of the Text property changes. (Inherited from ToolStripItem.)
Public eventVisibleChangedOccurs when the value of the Visible property changes. (Inherited from ToolStripItem.)
Top
  NameDescription
Explicit interface implemetationPrivate methodIDropTarget.OnDragDropRaises the DragDrop event. (Inherited from ToolStripItem.)
Explicit interface implemetationPrivate methodIDropTarget.OnDragEnterRaises the DragEnter event. (Inherited from ToolStripItem.)
Explicit interface implemetationPrivate methodIDropTarget.OnDragLeaveRaises the DragLeave event. (Inherited from ToolStripItem.)
Explicit interface implemetationPrivate methodIDropTarget.OnDragOverRaises the DragOver event. (Inherited from ToolStripItem.)
Top

ToolStripMenuItem is a ToolStripDropDownItem that works with ToolStripDropDownMenu and ContextMenuStrip to handle the special highlighting, layout, and column arrangement for menus.

In order for a ToolStripMenuItem to be displayed, you must add it to a MenuStrip or ContextMenuStrip.

The ToolStripMenuItem class provides properties that enable you to configure the appearance and functionality of a menu item. To display a check mark next to a menu item, use the Checked property. Use this feature to identify a menu item that is selected in a list of mutually exclusive menu items. For example, if you have a set of menu items for setting the color of text in a TextBox control, use the Checked property to identify which color is currently selected. Use the ShortcutKeys property to define a keyboard combination that can be pressed to select the menu item.

The following code example adds a ShortcutKeyDisplayString to the specified menu items of a ContextMenuStrip. This code example is part of a larger example available in the ToolStripManager class overview.

// Distinguish the merged items by setting the shortcut display string. 
foreach (ToolStripMenuItem tsmi in cmsItemsToMerge.Items)
{
    tsmi.ShortcutKeyDisplayString = "Merged Item";
}

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft. All rights reserved.