ToolStripDropDownItem Class
TOC
Collapse the table of content
Expand the table of content

ToolStripDropDownItem Class

 

Provides basic functionality for controls that display a ToolStripDropDown when a ToolStripDropDownButton, ToolStripMenuItem, or ToolStripSplitButton control is clicked.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      System.Windows.Forms.ToolStripItem
        System.Windows.Forms.ToolStripDropDownItem
          System.Windows.Forms.ToolStripDropDownButton
          System.Windows.Forms.ToolStripMenuItem
          System.Windows.Forms.ToolStripSplitButton

Public MustInherit Class ToolStripDropDownItem
	Inherits ToolStripItem

NameDescription
System_CAPS_protmethodToolStripDropDownItem()

Initializes a new instance of the ToolStripDropDownItem class.

System_CAPS_protmethodToolStripDropDownItem(String, Image, EventHandler)

Initializes a new instance of the ToolStripDropDownItem class with the specified display text, image, and action to take when the drop-down control is clicked.

System_CAPS_protmethodToolStripDropDownItem(String, Image, EventHandler, String)

Initializes a new instance of the ToolStripDropDownItem class with the specified display text, image, action to take when the drop-down control is clicked, and control name.

System_CAPS_protmethodToolStripDropDownItem(String, Image, ToolStripItem())

Initializes a new instance of the ToolStripDropDownItem class with the specified display text, image, and ToolStripItem collection that the drop-down control contains.

NameDescription
System_CAPS_pubpropertyAccessibilityObject

Gets the AccessibleObject assigned to the control.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyAccessibleDefaultActionDescription

Gets or sets the default action description of the control for use by accessibility client applications.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyAccessibleDescription

Gets or sets the description that will be reported to accessibility client applications.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyAccessibleName

Gets or sets the name of the control for use by accessibility client applications.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyAccessibleRole

Gets or sets the accessible role of the control, which specifies the type of user interface element of the control.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyAlignment

Gets or sets a value indicating whether the item aligns towards the beginning or end of the ToolStrip.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyAllowDrop

Gets or sets a value indicating whether drag-and-drop and item reordering are handled through events that you implement.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyAnchor

Gets 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.)

System_CAPS_pubpropertyAutoSize

Gets or sets a value indicating whether the item is automatically sized.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyAutoToolTip

Gets or sets a value indicating whether to use the Text property or the ToolTipText property for the ToolStripItem ToolTip. (Inherited from ToolStripItem.)

System_CAPS_pubpropertyAvailable

Gets or sets a value indicating whether the ToolStripItem should be placed on a ToolStrip.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyBackColor

Gets or sets the background color for the item.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyBackgroundImage

Gets or sets the background image displayed in the item.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyBackgroundImageLayout

Gets or sets the background image layout used for the ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyBounds

Gets the size and location of the item.(Inherited from ToolStripItem.)

System_CAPS_protpropertyCanRaiseEvents

Gets a value indicating whether the component can raise an event.(Inherited from Component.)

System_CAPS_pubpropertyCanSelect

Gets a value indicating whether the item can be selected.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyContainer

Gets the IContainer that contains the Component.(Inherited from Component.)

System_CAPS_pubpropertyContentRectangle

Gets the area where content, such as text and icons, can be placed within a ToolStripItem without overwriting background borders.(Inherited from ToolStripItem.)

System_CAPS_protpropertyDefaultAutoToolTip

Gets a value indicating whether to display the ToolTip that is defined as the default.(Inherited from ToolStripItem.)

System_CAPS_protpropertyDefaultDisplayStyle

Gets a value indicating what is displayed on the ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_protpropertyDefaultMargin

Gets the default margin of an item.(Inherited from ToolStripItem.)

System_CAPS_protpropertyDefaultPadding

Gets the internal spacing characteristics of the item.(Inherited from ToolStripItem.)

System_CAPS_protpropertyDefaultSize

Gets the default size of the item.(Inherited from ToolStripItem.)

System_CAPS_protpropertyDesignMode

Gets a value that indicates whether the Component is currently in design mode.(Inherited from Component.)

System_CAPS_protpropertyDismissWhenClicked

Gets a value indicating whether items on a ToolStripDropDown are hidden after they are clicked.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyDisplayStyle

Gets or sets whether text and images are displayed on a ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyDock

Gets or sets which ToolStripItem borders are docked to its parent control and determines how a ToolStripItem is resized with its parent.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyDoubleClickEnabled

Gets or sets a value indicating whether the ToolStripItem can be activated by double-clicking the mouse. (Inherited from ToolStripItem.)

System_CAPS_pubpropertyDropDown

Gets or sets the ToolStripDropDown that will be displayed when this ToolStripDropDownItem is clicked.

System_CAPS_pubpropertyDropDownDirection

Gets or sets a value indicating the direction in which the ToolStripDropDownItem emerges from its parent container.

System_CAPS_pubpropertyDropDownItems

Gets the collection of items in the ToolStripDropDown that is associated with this ToolStripDropDownItem.

System_CAPS_protpropertyDropDownLocation

Gets the screen coordinates, in pixels, of the upper-left corner of the ToolStripDropDownItem.

System_CAPS_pubpropertyEnabled

Gets or sets a value indicating whether the parent control of the ToolStripItem is enabled. (Inherited from ToolStripItem.)

System_CAPS_protpropertyEvents

Gets the list of event handlers that are attached to this Component.(Inherited from Component.)

System_CAPS_pubpropertyFont

Gets or sets the font of the text displayed by the item.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyForeColor

Gets or sets the foreground color of the item.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyHasDropDown

Gets or sets a value that indicates whether the DropDown for the ToolStripDropDownItem has been created.

System_CAPS_pubpropertyHasDropDownItems

Gets a value indicating whether the ToolStripDropDownItem has ToolStripDropDown controls associated with it.

System_CAPS_pubpropertyHeight

Gets or sets the height, in pixels, of a ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyImage

Gets or sets the image that is displayed on a ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyImageAlign

Gets or sets the alignment of the image on a ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyImageIndex

Gets or sets the index value of the image that is displayed on the item.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyImageKey

Gets or sets the key accessor for the image in the ImageList that is displayed on a ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyImageScaling

Gets or sets a value indicating whether an image on a ToolStripItem is automatically resized to fit in a container.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyImageTransparentColor

Gets or sets the color to treat as transparent in a ToolStripItem image.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyIsDisposed

Gets a value indicating whether the object has been disposed of.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyIsOnDropDown

Gets a value indicating whether the container of the current Control is a ToolStripDropDown. (Inherited from ToolStripItem.)

System_CAPS_pubpropertyIsOnOverflow

Gets a value indicating whether the Placement property is set to Overflow.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyMargin

Gets or sets the space between the item and adjacent items.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyMergeAction

Gets or sets how child menus are merged with parent menus. (Inherited from ToolStripItem.)

System_CAPS_pubpropertyMergeIndex

Gets or sets the position of a merged item within the current ToolStrip.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyName

Gets or sets the name of the item.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyOverflow

Gets or sets whether the item is attached to the ToolStrip or ToolStripOverflowButton or can float between the two.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyOwner

Gets or sets the owner of this item.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyOwnerItem

Gets the parent ToolStripItem of this ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyPadding

Gets or sets the internal spacing, in pixels, between the item's contents and its edges.(Inherited from ToolStripItem.)

System_CAPS_protpropertyParent

Gets or sets the parent container of the ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyPlacement

Gets the current layout of the item.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyPressed

Gets a value indicating whether the ToolStripDropDownItem is in the pressed state.(Overrides ToolStripItem.Pressed.)

System_CAPS_pubpropertyRightToLeft

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.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyRightToLeftAutoMirrorImage

Mirrors automatically the ToolStripItem image when the RightToLeft property is set to Yes.(Inherited from ToolStripItem.)

System_CAPS_pubpropertySelected

Gets a value indicating whether the item is selected.(Inherited from ToolStripItem.)

System_CAPS_protpropertyShowKeyboardCues

Gets a value indicating whether to show or hide shortcut keys.(Inherited from ToolStripItem.)

System_CAPS_pubpropertySite

Gets or sets the ISite of the Component.(Inherited from Component.)

System_CAPS_pubpropertySize

Gets or sets the size of the item.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyTag

Gets or sets the object that contains data about the item.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyText

Gets or sets the text that is to be displayed on the item.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyTextAlign

Gets or sets the alignment of the text on a ToolStripLabel.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyTextDirection

Gets the orientation of text used on a ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyTextImageRelation

Gets or sets the position of ToolStripItem text and image relative to each other.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyToolTipText

Gets or sets the text that appears as a ToolTip for a control.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyVisible

Gets or sets a value indicating whether the item is displayed.(Inherited from ToolStripItem.)

System_CAPS_pubpropertyWidth

Gets or sets the width in pixels of a ToolStripItem.(Inherited from ToolStripItem.)

NameDescription
System_CAPS_protmethodCreateAccessibilityInstance()

Creates a new accessibility object for the ToolStripItem.(Overrides ToolStripItem.CreateAccessibilityInstance().)

System_CAPS_protmethodCreateDefaultDropDown()

Creates a generic ToolStripDropDown for which events can be defined.

System_CAPS_pubmethodCreateObjRef(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.)

System_CAPS_pubmethodDispose()

Releases all resources used by the Component.(Inherited from Component.)

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources used by the ToolStripDropDownItem and optionally releases the managed resources. (Overrides ToolStripItem.Dispose(Boolean).)

System_CAPS_pubmethodDoDragDrop(Object, DragDropEffects)

Begins a drag-and-drop operation.(Inherited from ToolStripItem.)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.(Inherited from Component.)

System_CAPS_pubmethodGetCurrentParent()

Retrieves the ToolStrip that is the container of the current ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetLifetimeService()

Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodGetPreferredSize(Size)

Retrieves the size of a rectangular area into which a control can be fit.(Inherited from ToolStripItem.)

System_CAPS_protmethodGetService(Type)

Returns an object that represents a service provided by the Component or by its Container.(Inherited from Component.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodHideDropDown()

Makes a visible ToolStripDropDown hidden.

System_CAPS_pubmethodInitializeLifetimeService()

Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodInvalidate()

Invalidates the entire surface of the ToolStripItem and causes it to be redrawn.(Inherited from ToolStripItem.)

System_CAPS_pubmethodInvalidate(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.)

System_CAPS_protmethodIsInputChar(Char)

Determines whether a character is an input character that the item recognizes.(Inherited from ToolStripItem.)

System_CAPS_protmethodIsInputKey(Keys)

Determines whether the specified key is a regular input key or a special key that requires preprocessing.(Inherited from ToolStripItem.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.(Inherited from MarshalByRefObject.)

System_CAPS_protmethodOnAvailableChanged(EventArgs)

Raises the AvailableChanged event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnBackColorChanged(EventArgs)

Raises the BackColorChanged event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnBoundsChanged()

Occurs when the Bounds property changes.(Overrides ToolStripItem.OnBoundsChanged().)

System_CAPS_protmethodOnClick(EventArgs)

Raises the Click event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnDisplayStyleChanged(EventArgs)

Raises the DisplayStyleChanged event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnDoubleClick(EventArgs)

Raises the DoubleClick event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnDragDrop(DragEventArgs)

Raises the DragDrop event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnDragEnter(DragEventArgs)

Raises the DragEnter event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnDragLeave(EventArgs)

Raises the DragLeave event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnDragOver(DragEventArgs)

Raises the DragOver event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnDropDownClosed(EventArgs)

Raises the DropDownClosed event.

System_CAPS_protmethodOnDropDownHide(EventArgs)

Raised in response to the HideDropDown method.

System_CAPS_protmethodOnDropDownItemClicked(ToolStripItemClickedEventArgs)

Raises the DropDownItemClicked event.

System_CAPS_protmethodOnDropDownOpened(EventArgs)

Raises the DropDownOpened event.

System_CAPS_protmethodOnDropDownShow(EventArgs)

Raised in response to the ShowDropDown method.

System_CAPS_protmethodOnEnabledChanged(EventArgs)

Raises the EnabledChanged event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnFontChanged(EventArgs)
System_CAPS_protmethodOnForeColorChanged(EventArgs)

Raises the ForeColorChanged event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnGiveFeedback(GiveFeedbackEventArgs)

Raises the GiveFeedback event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnLayout(LayoutEventArgs)

Raises the Layout event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnLocationChanged(EventArgs)

Raises the LocationChanged event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnMouseDown(MouseEventArgs)

Raises the MouseDown event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnMouseEnter(EventArgs)

Raises the MouseEnter event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnMouseHover(EventArgs)

Raises the MouseHover event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnMouseLeave(EventArgs)

Raises the MouseLeave event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnMouseMove(MouseEventArgs)

Raises the MouseMove event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnMouseUp(MouseEventArgs)

Raises the MouseUp event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnOwnerChanged(EventArgs)

Raises the OwnerChanged event. (Inherited from ToolStripItem.)

System_CAPS_protmethodOnOwnerFontChanged(EventArgs)

Raises the FontChanged event when the Font property has changed on the parent of the ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnPaint(PaintEventArgs)

Raises the Paint event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnParentBackColorChanged(EventArgs)

Raises the BackColorChanged event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnParentChanged(ToolStrip, ToolStrip)

Raises the ParentChanged event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnParentEnabledChanged(EventArgs)

Raises the EnabledChanged event when the Enabled property value of the item's container changes.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnParentForeColorChanged(EventArgs)

Raises the ForeColorChanged event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnParentRightToLeftChanged(EventArgs)

Raises the RightToLeftChanged event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnQueryContinueDrag(QueryContinueDragEventArgs)

Raises the QueryContinueDrag event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnRightToLeftChanged(EventArgs)
System_CAPS_protmethodOnTextChanged(EventArgs)

Raises the TextChanged event.(Inherited from ToolStripItem.)

System_CAPS_protmethodOnVisibleChanged(EventArgs)

Raises the VisibleChanged event.(Inherited from ToolStripItem.)

System_CAPS_pubmethodPerformClick()

Generates a Click event for a ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_protmethodProcessCmdKey(Message, Keys)

Processes a command key.(Overrides ToolStripItem.ProcessCmdKey(Message, Keys).)

System_CAPS_protmethodProcessDialogKey(Keys)

Processes a dialog key.(Overrides ToolStripItem.ProcessDialogKey(Keys).)

System_CAPS_protmethodProcessMnemonic(Char)

Processes a mnemonic character.(Inherited from ToolStripItem.)

System_CAPS_pubmethodResetBackColor()

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.(Inherited from ToolStripItem.)

System_CAPS_pubmethodResetDisplayStyle()

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.(Inherited from ToolStripItem.)

System_CAPS_pubmethodResetFont()

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.(Inherited from ToolStripItem.)

System_CAPS_pubmethodResetForeColor()

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.(Inherited from ToolStripItem.)

System_CAPS_pubmethodResetImage()

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.(Inherited from ToolStripItem.)

System_CAPS_pubmethodResetMargin()

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.(Inherited from ToolStripItem.)

System_CAPS_pubmethodResetPadding()

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.(Inherited from ToolStripItem.)

System_CAPS_pubmethodResetRightToLeft()

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.(Inherited from ToolStripItem.)

System_CAPS_pubmethodResetTextDirection()

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.(Inherited from ToolStripItem.)

System_CAPS_pubmethodSelect()

Selects the item.(Inherited from ToolStripItem.)

System_CAPS_protmethodSetBounds(Rectangle)

Sets the size and location of the item.(Inherited from ToolStripItem.)

System_CAPS_protmethodSetVisibleCore(Boolean)

Sets the ToolStripItem to the specified visible state. (Inherited from ToolStripItem.)

System_CAPS_pubmethodShowDropDown()

Displays the ToolStripDropDownItem control associated with this ToolStripDropDownItem.

System_CAPS_pubmethodToString()

Returns a String containing the name of the Component, if any. This method should not be overridden.(Inherited from ToolStripItem.)

NameDescription
System_CAPS_pubeventAvailableChanged

Occurs when the value of the Available property changes.(Inherited from ToolStripItem.)

System_CAPS_pubeventBackColorChanged

Occurs when the value of the BackColor property changes.(Inherited from ToolStripItem.)

System_CAPS_pubeventClick

Occurs when the ToolStripItem is clicked.(Inherited from ToolStripItem.)

System_CAPS_pubeventDisplayStyleChanged

Occurs when the DisplayStyle has changed.(Inherited from ToolStripItem.)

System_CAPS_pubeventDisposed

Occurs when the component is disposed by a call to the Dispose method. (Inherited from Component.)

System_CAPS_pubeventDoubleClick

Occurs when the item is double-clicked with the mouse.(Inherited from ToolStripItem.)

System_CAPS_pubeventDragDrop

Occurs 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.)

System_CAPS_pubeventDragEnter

Occurs when the user drags an item into the client area of this item.(Inherited from ToolStripItem.)

System_CAPS_pubeventDragLeave

Occurs when the user drags an item and the mouse pointer is no longer over the client area of this item.(Inherited from ToolStripItem.)

System_CAPS_pubeventDragOver

Occurs when the user drags an item over the client area of this item.(Inherited from ToolStripItem.)

System_CAPS_pubeventDropDownClosed

Occurs when the ToolStripDropDown closes.

System_CAPS_pubeventDropDownItemClicked

Occurs when the ToolStripDropDown is clicked.

System_CAPS_pubeventDropDownOpened

Occurs when the ToolStripDropDown has opened.

System_CAPS_pubeventDropDownOpening

Occurs as the ToolStripDropDown is opening.

System_CAPS_pubeventEnabledChanged

Occurs when the Enabled property value has changed.(Inherited from ToolStripItem.)

System_CAPS_pubeventForeColorChanged

Occurs when the ForeColor property value changes.(Inherited from ToolStripItem.)

System_CAPS_pubeventGiveFeedback

Occurs during a drag operation.(Inherited from ToolStripItem.)

System_CAPS_pubeventLocationChanged

Occurs when the location of a ToolStripItem is updated.(Inherited from ToolStripItem.)

System_CAPS_pubeventMouseDown

Occurs when the mouse pointer is over the item and a mouse button is pressed.(Inherited from ToolStripItem.)

System_CAPS_pubeventMouseEnter

Occurs when the mouse pointer enters the item.(Inherited from ToolStripItem.)

System_CAPS_pubeventMouseHover

Occurs when the mouse pointer hovers over the item.(Inherited from ToolStripItem.)

System_CAPS_pubeventMouseLeave

Occurs when the mouse pointer leaves the item.(Inherited from ToolStripItem.)

System_CAPS_pubeventMouseMove

Occurs when the mouse pointer is moved over the item.(Inherited from ToolStripItem.)

System_CAPS_pubeventMouseUp

Occurs when the mouse pointer is over the item and a mouse button is released.(Inherited from ToolStripItem.)

System_CAPS_pubeventOwnerChanged

Occurs when the Owner property changes. (Inherited from ToolStripItem.)

System_CAPS_pubeventPaint

Occurs when the item is redrawn.(Inherited from ToolStripItem.)

System_CAPS_pubeventQueryAccessibilityHelp

Occurs when an accessibility client application invokes help for the ToolStripItem.(Inherited from ToolStripItem.)

System_CAPS_pubeventQueryContinueDrag

Occurs 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.)

System_CAPS_pubeventRightToLeftChanged

Occurs when the RightToLeft property value changes.(Inherited from ToolStripItem.)

System_CAPS_pubeventTextChanged

Occurs when the value of the Text property changes.(Inherited from ToolStripItem.)

System_CAPS_pubeventVisibleChanged

Occurs when the value of the Visible property changes.(Inherited from ToolStripItem.)

ToolStripDropDownItem is the abstract base class for ToolStripMenuItem, ToolStripDropDownButton, and ToolStripSplitButton, which can host items directly or host additional items in a drop-down container. You do this by setting the DropDown property to a ToolStripDropDown and setting the Items property of the ToolStripDropDown. Access these drop-down items directly through the DropDownItems property.

The following code example demonstrates how to show and hide ToolStripMenuItem controls.

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms

Public Class Form1
   Inherits Form
   Private toolStrip1 As ToolStrip
   Private statusStrip1 As StatusStrip
   Private toolStripStatusLabel1 As ToolStripStatusLabel
   Private contextMenuStrip1 As ContextMenuStrip
   Private menuItem1ToolStripMenuItem As ToolStripMenuItem
   Private menuItem2ToolStripMenuItem As ToolStripMenuItem
   Private subItemToolStripMenuItem As ToolStripMenuItem
   Private subItem2ToolStripMenuItem As ToolStripMenuItem
   Private WithEvents showButton As Button
   Private WithEvents hideButton As Button
   Private components As System.ComponentModel.IContainer = Nothing


   Public Sub New()
      InitializeComponent()
      Me.InitializeToolStripDropDownItems()
    End Sub

   ' This utility method creates and initializes three 
   ' ToolStripDropDownItem controls and adds them 
   ' to the form's ToolStrip control.
   Private Sub InitializeToolStripDropDownItems()
      Dim b As New ToolStripDropDownButton("DropDownButton")
      b.DropDown = Me.contextMenuStrip1
      AddHandler b.DropDownClosed, AddressOf toolStripDropDownItem_DropDownClosed
      AddHandler b.DropDownItemClicked, AddressOf toolStripDropDownItem_DropDownItemClicked
      AddHandler b.DropDownOpened, AddressOf toolStripDropDownItem_DropDownOpened

      Dim m As New ToolStripMenuItem("MenuItem")
      m.DropDown = Me.contextMenuStrip1
      AddHandler m.DropDownClosed, AddressOf toolStripDropDownItem_DropDownClosed
      AddHandler m.DropDownItemClicked, AddressOf toolStripDropDownItem_DropDownItemClicked
      AddHandler m.DropDownOpened, AddressOf toolStripDropDownItem_DropDownOpened

      Dim sb As New ToolStripSplitButton("SplitButton")
      sb.DropDown = Me.contextMenuStrip1
      AddHandler sb.DropDownClosed, AddressOf toolStripDropDownItem_DropDownClosed
      AddHandler sb.DropDownItemClicked, AddressOf toolStripDropDownItem_DropDownItemClicked
      AddHandler sb.DropDownOpened, AddressOf toolStripDropDownItem_DropDownOpened

      Me.toolStrip1.Items.AddRange(New ToolStripItem() {b, m, sb})
   End Sub 

   ' This method handles the DropDownOpened event from a 
   ' ToolStripDropDownItem. It displays the value of the 
   ' item's Text property in the form's StatusStrip control.
    Private Sub toolStripDropDownItem_DropDownOpened(ByVal sender As Object, ByVal e As EventArgs)

        Dim item As ToolStripDropDownItem = CType(sender, ToolStripDropDownItem)

        Dim msg As String = String.Format("Item opened: {0}", item.Text)
        Me.toolStripStatusLabel1.Text = msg

    End Sub

   ' This method handles the DropDownItemClicked event from a 
   ' ToolStripDropDownItem. It displays the value of the clicked
   ' item's Text property in the form's StatusStrip control.
    Private Sub toolStripDropDownItem_DropDownItemClicked( _
    ByVal sender As Object, _
    ByVal e As ToolStripItemClickedEventArgs)

        Dim msg As String = String.Format("Item clicked: {0}", e.ClickedItem.Text)
        Me.toolStripStatusLabel1.Text = msg

    End Sub

   ' This method handles the DropDownClosed event from a 
   ' ToolStripDropDownItem. It displays the value of the 
   ' item's Text property in the form's StatusStrip control.
    Private Sub toolStripDropDownItem_DropDownClosed(ByVal sender As Object, ByVal e As EventArgs)

        Dim item As ToolStripDropDownItem = CType(sender, ToolStripDropDownItem)

        Dim msg As String = String.Format("Item closed: {0}", item.Text)
        Me.toolStripStatusLabel1.Text = msg

    End Sub

   ' This method shows the drop-down for the first item
   ' in the form's ToolStrip.
    Private Sub showButton_Click( _
    ByVal sender As Object, _
    ByVal e As EventArgs) _
    Handles showButton.Click

        Dim item As ToolStripDropDownItem = CType(Me.toolStrip1.Items(0), ToolStripDropDownItem)

        If item.HasDropDownItems Then
            item.ShowDropDown()
        End If

    End Sub

   ' This method hides the drop-down for the first item
   ' in the form's ToolStrip.
    Private Sub hideButton_Click( _
    ByVal sender As Object, _
    ByVal e As EventArgs) _
    Handles hideButton.Click

        Dim item As ToolStripDropDownItem = CType(Me.toolStrip1.Items(0), ToolStripDropDownItem)

        item.HideDropDown()
    End Sub

   Protected Overrides Sub Dispose(disposing As Boolean)
      If disposing AndAlso (components IsNot Nothing) Then
         components.Dispose()
      End If
      MyBase.Dispose(disposing)
    End Sub

   #Region "Windows Form Designer generated code"


   Private Sub InitializeComponent()
      Me.components = New System.ComponentModel.Container()
      Me.toolStrip1 = New System.Windows.Forms.ToolStrip()
      Me.statusStrip1 = New System.Windows.Forms.StatusStrip()
      Me.toolStripStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel()
      Me.contextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
      Me.menuItem1ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
      Me.menuItem2ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
      Me.subItemToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
      Me.subItem2ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
      Me.showButton = New System.Windows.Forms.Button()
      Me.hideButton = New System.Windows.Forms.Button()
      Me.statusStrip1.SuspendLayout()
      Me.contextMenuStrip1.SuspendLayout()
      Me.SuspendLayout()
      ' 
      ' toolStrip1
      ' 
      Me.toolStrip1.Location = New System.Drawing.Point(0, 0)
      Me.toolStrip1.Name = "toolStrip1"
      Me.toolStrip1.Size = New System.Drawing.Size(292, 25)
      Me.toolStrip1.TabIndex = 0
      Me.toolStrip1.Text = "toolStrip1"
      ' 
      ' statusStrip1
      ' 
      Me.statusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripStatusLabel1})
      Me.statusStrip1.Location = New System.Drawing.Point(0, 251)
      Me.statusStrip1.Name = "statusStrip1"
      Me.statusStrip1.Size = New System.Drawing.Size(292, 22)
      Me.statusStrip1.TabIndex = 1
      Me.statusStrip1.Text = "statusStrip1"
      ' 
      ' toolStripStatusLabel1
      ' 
      Me.toolStripStatusLabel1.Name = "toolStripStatusLabel1"
      Me.toolStripStatusLabel1.Size = New System.Drawing.Size(38, 17)
      Me.toolStripStatusLabel1.Text = "Ready"
      ' 
      ' contextMenuStrip1
      ' 
      Me.contextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.menuItem1ToolStripMenuItem, Me.menuItem2ToolStripMenuItem})
      Me.contextMenuStrip1.Name = "contextMenuStrip1"
      Me.contextMenuStrip1.RightToLeft = System.Windows.Forms.RightToLeft.No
      Me.contextMenuStrip1.Size = New System.Drawing.Size(146, 48)
      ' 
      ' menuItem1ToolStripMenuItem
      ' 
      Me.menuItem1ToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.subItemToolStripMenuItem})
      Me.menuItem1ToolStripMenuItem.Name = "menuItem1ToolStripMenuItem"
      Me.menuItem1ToolStripMenuItem.Size = New System.Drawing.Size(145, 22)
      Me.menuItem1ToolStripMenuItem.Text = "Menu Item1"
      ' 
      ' menuItem2ToolStripMenuItem
      ' 
      Me.menuItem2ToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.subItem2ToolStripMenuItem})
      Me.menuItem2ToolStripMenuItem.Name = "menuItem2ToolStripMenuItem"
      Me.menuItem2ToolStripMenuItem.Size = New System.Drawing.Size(145, 22)
      Me.menuItem2ToolStripMenuItem.Text = "Menu Item 2"
      ' 
      ' subItemToolStripMenuItem
      ' 
      Me.subItemToolStripMenuItem.Name = "subItemToolStripMenuItem"
      Me.subItemToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
      Me.subItemToolStripMenuItem.Text = "Sub Item"
      ' 
      ' subItem2ToolStripMenuItem
      ' 
      Me.subItem2ToolStripMenuItem.Name = "subItem2ToolStripMenuItem"
      Me.subItem2ToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
      Me.subItem2ToolStripMenuItem.Text = "Sub Item2"
      ' 
      ' showButton
      ' 
      Me.showButton.Location = New System.Drawing.Point(12, 180)
      Me.showButton.Name = "showButton"
      Me.showButton.Size = New System.Drawing.Size(75, 23)
      Me.showButton.TabIndex = 2
      Me.showButton.Text = "Show"
      Me.showButton.UseVisualStyleBackColor = True
      ' 
      ' hideButton
      ' 
      Me.hideButton.Location = New System.Drawing.Point(12, 209)
      Me.hideButton.Name = "hideButton"
      Me.hideButton.Size = New System.Drawing.Size(75, 23)
      Me.hideButton.TabIndex = 3
      Me.hideButton.Text = "Hide"
      Me.hideButton.UseVisualStyleBackColor = True
      ' 
      ' Form1
      ' 
      Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
      Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
      Me.ClientSize = New System.Drawing.Size(292, 273)
      Me.Controls.Add(statusStrip1)
      Me.Controls.Add(hideButton)
      Me.Controls.Add(toolStrip1)
      Me.Controls.Add(showButton)
      Me.Name = "Form1"
      Me.Text = "Form1"
      Me.statusStrip1.ResumeLayout(False)
      Me.statusStrip1.PerformLayout()
      Me.contextMenuStrip1.ResumeLayout(False)
      Me.ResumeLayout(False)
      Me.PerformLayout()
    End Sub

   #End Region
End Class


Public Class Program

    ' <summary>
    ' The main entry point for the application.
    ' </summary>
    <STAThread()> _
    Shared Sub Main()
        Application.EnableVisualStyles()
        Application.SetCompatibleTextRenderingDefault(False)
        Application.Run(New Form1())
    End Sub
End Class

.NET Framework
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.

Return to top
Show:
© 2016 Microsoft