ToolStripControlHost ToolStripControlHost ToolStripControlHost ToolStripControlHost Class

Definition

Hosts custom controls or Windows Forms controls.

public ref class ToolStripControlHost : System::Windows::Forms::ToolStripItem
public class ToolStripControlHost : System.Windows.Forms.ToolStripItem
type ToolStripControlHost = class
    inherit ToolStripItem
Public Class ToolStripControlHost
Inherits ToolStripItem
Inheritance
Derived

Examples

The following code example demonstrates constructing a ToolStripControlHost with a MonthCalendar control, using OnSubscribeControlEvents to handle events, and exposing some of its members to the ToolStripControlHost.

//Declare a class that inherits from ToolStripControlHost.
public ref class ToolStripMonthCalendar: public ToolStripControlHost
{
public:
   // Call the base constructor passing in a MonthCalendar instance.
   ToolStripMonthCalendar() : ToolStripControlHost( gcnew MonthCalendar ) {}

   property MonthCalendar^ MonthCalendarControl 
   {
      MonthCalendar^ get()
      {
         return static_cast<MonthCalendar^>(Control);
      }
   }
   property Day FirstDayOfWeek 
   {
      // Expose the MonthCalendar.FirstDayOfWeek as a property.
      Day get()
      {
         return MonthCalendarControl->FirstDayOfWeek;
      }

      void set( Day value )
      {
         MonthCalendarControl->FirstDayOfWeek = value;
      }
   }

   // Expose the AddBoldedDate method.
   void AddBoldedDate( DateTime dateToBold )
   {
      MonthCalendarControl->AddBoldedDate( dateToBold );
   }

protected:
   // Subscribe and unsubscribe the control events you wish to expose.
   void OnSubscribeControlEvents( System::Windows::Forms::Control^ c )
   {
      // Call the base so the base events are connected.
      __super::OnSubscribeControlEvents( c );
      
      // Cast the control to a MonthCalendar control.
      MonthCalendar^ monthCalendarControl = (MonthCalendar^)c;
      
      // Add the event.
      monthCalendarControl->DateChanged += gcnew DateRangeEventHandler( this, &ToolStripMonthCalendar::HandleDateChanged );
   }

   void OnUnsubscribeControlEvents( System::Windows::Forms::Control^ c )
   {
      
      // Call the base method so the basic events are unsubscribed.
      __super::OnUnsubscribeControlEvents( c );
      
      // Cast the control to a MonthCalendar control.
      MonthCalendar^ monthCalendarControl = (MonthCalendar^)c;
      
      // Remove the event.
      monthCalendarControl->DateChanged -= gcnew DateRangeEventHandler( this, &ToolStripMonthCalendar::HandleDateChanged );
   }

public:
   event DateRangeEventHandler^ DateChanged;

private:
   // Declare the DateChanged event.
   // Raise the DateChanged event.
   void HandleDateChanged( Object^ sender, DateRangeEventArgs^ e )
   {
      if ( DateChanged != nullptr )
      {
         DateChanged( this, e );
      }
   }
};
//Declare a class that inherits from ToolStripControlHost.
public class ToolStripMonthCalendar : ToolStripControlHost
{
	// Call the base constructor passing in a MonthCalendar instance.
	public ToolStripMonthCalendar() : base (new MonthCalendar()) { }

	public MonthCalendar MonthCalendarControl
	{
		get
		{
			return Control as MonthCalendar;
		}
	}

	// Expose the MonthCalendar.FirstDayOfWeek as a property.
	public Day FirstDayOfWeek
	{
		get
		{
			return MonthCalendarControl.FirstDayOfWeek;
		}
		set { MonthCalendarControl.FirstDayOfWeek = value; }
	}

	// Expose the AddBoldedDate method.
	public void AddBoldedDate(DateTime dateToBold)
	{
		MonthCalendarControl.AddBoldedDate(dateToBold);
	}

	// Subscribe and unsubscribe the control events you wish to expose.
	protected override void OnSubscribeControlEvents(Control c)
	{
		// Call the base so the base events are connected.
		base.OnSubscribeControlEvents(c);

		// Cast the control to a MonthCalendar control.
		MonthCalendar monthCalendarControl = (MonthCalendar) c;

		// Add the event.
		monthCalendarControl.DateChanged +=
			new DateRangeEventHandler(OnDateChanged);
	}

	protected override void OnUnsubscribeControlEvents(Control c)
	{
		// Call the base method so the basic events are unsubscribed.
		base.OnUnsubscribeControlEvents(c);

		// Cast the control to a MonthCalendar control.
		MonthCalendar monthCalendarControl = (MonthCalendar) c;

		// Remove the event.
		monthCalendarControl.DateChanged -=
			new DateRangeEventHandler(OnDateChanged);
	}

	// Declare the DateChanged event.
	public event DateRangeEventHandler DateChanged;

	// Raise the DateChanged event.
	private void OnDateChanged(object sender, DateRangeEventArgs e)
	{
		if (DateChanged != null)
		{
			DateChanged(this, e);
		}
	}
}
'Declare a class that inherits from ToolStripControlHost.

Public Class ToolStripMonthCalendar
    Inherits ToolStripControlHost
    
    ' Call the base constructor passing in a MonthCalendar instance.
    Public Sub New() 
        MyBase.New(New MonthCalendar())
    
    End Sub

    Public ReadOnly Property MonthCalendarControl() As MonthCalendar 
        Get
            Return CType(Control, MonthCalendar)
        End Get
    End Property

    ' Expose the MonthCalendar.FirstDayOfWeek as a property.
    Public Property FirstDayOfWeek() As Day 
        Get
            Return MonthCalendarControl.FirstDayOfWeek
        End Get
        Set
            MonthCalendarControl.FirstDayOfWeek = value
        End Set
    End Property
     
    ' Expose the AddBoldedDate method.
    Public Sub AddBoldedDate(ByVal dateToBold As DateTime) 
        MonthCalendarControl.AddBoldedDate(dateToBold)
    
    End Sub

    ' Subscribe and unsubscribe the control events you wish to expose.
    Protected Overrides Sub OnSubscribeControlEvents(ByVal c As Control) 

        ' Call the base so the base events are connected.
        MyBase.OnSubscribeControlEvents(c)
        
        ' Cast the control to a MonthCalendar control.
        Dim monthCalendarControl As MonthCalendar = _
            CType(c, MonthCalendar)

        ' Add the event.
        AddHandler monthCalendarControl.DateChanged, _
            AddressOf HandleDateChanged
    
    End Sub

    Protected Overrides Sub OnUnsubscribeControlEvents(ByVal c As Control)
        ' Call the base method so the basic events are unsubscribed.
        MyBase.OnUnsubscribeControlEvents(c)

        ' Cast the control to a MonthCalendar control.
        Dim monthCalendarControl As MonthCalendar = _
            CType(c, MonthCalendar)

        ' Remove the event.
        RemoveHandler monthCalendarControl.DateChanged, _
            AddressOf HandleDateChanged

    End Sub

    ' Declare the DateChanged event.
    Public Event DateChanged As DateRangeEventHandler

    ' Raise the DateChanged event.
    Private Sub HandleDateChanged(ByVal sender As Object, _
        ByVal e As DateRangeEventArgs)

        RaiseEvent DateChanged(Me, e)
    End Sub
End Class

Remarks

ToolStripControlHost is the abstract base class for ToolStripComboBox, ToolStripTextBox, and ToolStripProgressBar. ToolStripControlHost can host other controls, including custom controls, in two ways:

  • Construct a ToolStripControlHost with a class that derives from Control. To fully access the hosted control and properties, you must cast the Control property back to the actual class it represents.

  • Extend ToolStripControlHost, and in the inherited class's default constructor, call the base class constructor passing a class that derives from Control. This option lets you wrap common control methods and properties for easy access in a ToolStrip.

Use the ToolStripControlHost class to host your customized controls or any other Windows Forms control.

To customize a ToolStripItem, derive from ToolStripControlHost and create a custom implementation. You can override methods such as OnSubscribeControlEvents to handle events raised by the hosted controls, and you can put custom functionality into properties to enhance the hosted control.

Constructors

ToolStripControlHost(Control) ToolStripControlHost(Control) ToolStripControlHost(Control) ToolStripControlHost(Control)

Initializes a new instance of the ToolStripControlHost class that hosts the specified control.

ToolStripControlHost(Control, String) ToolStripControlHost(Control, String) ToolStripControlHost(Control, String) ToolStripControlHost(Control, String)

Initializes a new instance of the ToolStripControlHost class that hosts the specified control and that has the specified name.

Properties

AccessibilityObject AccessibilityObject AccessibilityObject AccessibilityObject

Gets the AccessibleObject assigned to the control.

(Inherited from ToolStripItem)
AccessibleDefaultActionDescription AccessibleDefaultActionDescription AccessibleDefaultActionDescription AccessibleDefaultActionDescription

Gets or sets the default action description of the control for use by accessibility client applications.

(Inherited from ToolStripItem)
AccessibleDescription AccessibleDescription AccessibleDescription AccessibleDescription

Gets or sets the description that will be reported to accessibility client applications.

(Inherited from ToolStripItem)
AccessibleName AccessibleName AccessibleName AccessibleName

Gets or sets the name of the control for use by accessibility client applications.

(Inherited from ToolStripItem)
AccessibleRole AccessibleRole AccessibleRole AccessibleRole

Gets or sets the accessible role of the control, which specifies the type of user interface element of the control.

(Inherited from ToolStripItem)
Alignment Alignment Alignment Alignment

Gets or sets a value indicating whether the item aligns towards the beginning or end of the ToolStrip.

(Inherited from ToolStripItem)
AllowDrop AllowDrop AllowDrop AllowDrop

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

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

(Inherited from ToolStripItem)
AutoSize AutoSize AutoSize AutoSize

Gets or sets a value indicating whether the item is automatically sized.

(Inherited from ToolStripItem)
AutoToolTip AutoToolTip AutoToolTip AutoToolTip

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

(Inherited from ToolStripItem)
Available Available Available Available

Gets or sets a value indicating whether the ToolStripItem should be placed on a ToolStrip.

(Inherited from ToolStripItem)
BackColor BackColor BackColor BackColor

Gets or sets the background color for the control.

BackgroundImage BackgroundImage BackgroundImage BackgroundImage

Gets or sets the background image displayed in the control.

BackgroundImageLayout BackgroundImageLayout BackgroundImageLayout BackgroundImageLayout

Gets or sets the background image layout as defined in the ImageLayout enumeration.

Bounds Bounds Bounds Bounds

Gets the size and location of the item.

(Inherited from ToolStripItem)
CanRaiseEvents CanRaiseEvents CanRaiseEvents CanRaiseEvents

Gets a value indicating whether the component can raise an event.

(Inherited from Component)
CanSelect CanSelect CanSelect CanSelect

Gets a value indicating whether the control can be selected.

CausesValidation CausesValidation CausesValidation CausesValidation

Gets or sets a value indicating whether the hosted control causes and raises validation events on other controls when the hosted control receives focus.

Container Container Container Container

Gets the IContainer that contains the Component.

(Inherited from Component)
ContentRectangle ContentRectangle ContentRectangle ContentRectangle

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

(Inherited from ToolStripItem)
Control Control Control Control

Gets the Control that this ToolStripControlHost is hosting.

ControlAlign ControlAlign ControlAlign ControlAlign

Gets or sets the alignment of the control on the form.

DefaultAutoToolTip DefaultAutoToolTip DefaultAutoToolTip DefaultAutoToolTip

Gets a value indicating whether to display the ToolTip that is defined as the default.

(Inherited from ToolStripItem)
DefaultDisplayStyle DefaultDisplayStyle DefaultDisplayStyle DefaultDisplayStyle

Gets a value indicating what is displayed on the ToolStripItem.

(Inherited from ToolStripItem)
DefaultMargin DefaultMargin DefaultMargin DefaultMargin

Gets the default margin of an item.

(Inherited from ToolStripItem)
DefaultPadding DefaultPadding DefaultPadding DefaultPadding

Gets the internal spacing characteristics of the item.

(Inherited from ToolStripItem)
DefaultSize DefaultSize DefaultSize DefaultSize

Gets the default size of the control.

DesignMode DesignMode DesignMode DesignMode

Gets a value that indicates whether the Component is currently in design mode.

(Inherited from Component)
DismissWhenClicked DismissWhenClicked DismissWhenClicked DismissWhenClicked

Gets a value indicating whether items on a ToolStripDropDown are hidden after they are clicked.

(Inherited from ToolStripItem)
DisplayStyle DisplayStyle DisplayStyle DisplayStyle

This property is not relevant to this class.

Dock Dock Dock Dock

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)
DoubleClickEnabled DoubleClickEnabled DoubleClickEnabled DoubleClickEnabled

This property is not relevant to this class.

Enabled Enabled Enabled Enabled

Gets or sets a value indicating whether the parent control of the ToolStripItem is enabled.

Events Events Events Events

Gets the list of event handlers that are attached to this Component.

(Inherited from Component)
Focused Focused Focused Focused

Gets a value indicating whether the control has input focus.

Font Font Font Font

Gets or sets the font to be used on the hosted control.

ForeColor ForeColor ForeColor ForeColor

Gets or sets the foreground color of the hosted control.

Height Height Height Height

Gets or sets the height, in pixels, of a ToolStripItem.

(Inherited from ToolStripItem)
Image Image Image Image

The image associated with the object.

ImageAlign ImageAlign ImageAlign ImageAlign

This property is not relevant to this class.

ImageIndex ImageIndex ImageIndex ImageIndex

Gets or sets the index value of the image that is displayed on the item.

(Inherited from ToolStripItem)
ImageKey ImageKey ImageKey ImageKey

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

(Inherited from ToolStripItem)
ImageScaling ImageScaling ImageScaling ImageScaling

This property is not relevant to this class.

ImageTransparentColor ImageTransparentColor ImageTransparentColor ImageTransparentColor

This property is not relevant to this class.

IsDisposed IsDisposed IsDisposed IsDisposed

Gets a value indicating whether the object has been disposed of.

(Inherited from ToolStripItem)
IsOnDropDown IsOnDropDown IsOnDropDown IsOnDropDown

Gets a value indicating whether the container of the current Control is a ToolStripDropDown.

(Inherited from ToolStripItem)
IsOnOverflow IsOnOverflow IsOnOverflow IsOnOverflow

Gets a value indicating whether the Placement property is set to Overflow.

(Inherited from ToolStripItem)
Margin Margin Margin Margin

Gets or sets the space between the item and adjacent items.

(Inherited from ToolStripItem)
MergeAction MergeAction MergeAction MergeAction

Gets or sets how child menus are merged with parent menus.

(Inherited from ToolStripItem)
MergeIndex MergeIndex MergeIndex MergeIndex

Gets or sets the position of a merged item within the current ToolStrip.

(Inherited from ToolStripItem)
Name Name Name Name

Gets or sets the name of the item.

(Inherited from ToolStripItem)
Overflow Overflow Overflow Overflow

Gets or sets whether the item is attached to the ToolStrip or ToolStripOverflowButton or can float between the two.

(Inherited from ToolStripItem)
Owner Owner Owner Owner

Gets or sets the owner of this item.

(Inherited from ToolStripItem)
OwnerItem OwnerItem OwnerItem OwnerItem

Gets the parent ToolStripItem of this ToolStripItem.

(Inherited from ToolStripItem)
Padding Padding Padding Padding

Gets or sets the internal spacing, in pixels, between the item's contents and its edges.

(Inherited from ToolStripItem)
Parent Parent Parent Parent

Gets or sets the parent container of the ToolStripItem.

(Inherited from ToolStripItem)
Placement Placement Placement Placement

Gets the current layout of the item.

(Inherited from ToolStripItem)
Pressed Pressed Pressed Pressed

Gets a value indicating whether the state of the item is pressed.

(Inherited from ToolStripItem)
RightToLeft RightToLeft RightToLeft RightToLeft

Gets or sets a value indicating whether control's elements are aligned to support locales using right-to-left fonts.

RightToLeftAutoMirrorImage RightToLeftAutoMirrorImage RightToLeftAutoMirrorImage RightToLeftAutoMirrorImage

This property is not relevant to this class.

Selected Selected Selected Selected

Gets a value indicating whether the item is selected.

ShowKeyboardCues ShowKeyboardCues ShowKeyboardCues ShowKeyboardCues

Gets a value indicating whether to show or hide shortcut keys.

(Inherited from ToolStripItem)
Site Site Site Site

Gets or sets the site of the hosted control.

Size Size Size Size

Gets or sets the size of the ToolStripItem.

Tag Tag Tag Tag

Gets or sets the object that contains data about the item.

(Inherited from ToolStripItem)
Text Text Text Text

Gets or sets the text to be displayed on the hosted control.

TextAlign TextAlign TextAlign TextAlign

This property is not relevant to this class.

TextDirection TextDirection TextDirection TextDirection

This property is not relevant to this class.

TextImageRelation TextImageRelation TextImageRelation TextImageRelation

This property is not relevant to this class.

ToolTipText ToolTipText ToolTipText ToolTipText

Gets or sets the text that appears as a ToolTip for a control.

(Inherited from ToolStripItem)
Visible Visible Visible Visible

Gets or sets a value indicating whether the item is displayed.

(Inherited from ToolStripItem)
Width Width Width Width

Gets or sets the width in pixels of a ToolStripItem.

(Inherited from ToolStripItem)

Methods

CreateAccessibilityInstance() CreateAccessibilityInstance() CreateAccessibilityInstance() CreateAccessibilityInstance()

Creates a new accessibility object for the control.

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) 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() Dispose() Dispose()

Releases all resources used by the Component.

(Inherited from Component)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Releases the unmanaged resources used by the ToolStripControlHost and optionally releases the managed resources.

DoDragDrop(Object, DragDropEffects) DoDragDrop(Object, DragDropEffects) DoDragDrop(Object, DragDropEffects) DoDragDrop(Object, DragDropEffects)

Begins a drag-and-drop operation.

(Inherited from ToolStripItem)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Focus() Focus() Focus() Focus()

Gives the focus to a control.

GetCurrentParent() GetCurrentParent() GetCurrentParent() GetCurrentParent()

Retrieves the ToolStrip that is the container of the current ToolStripItem.

(Inherited from ToolStripItem)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetPreferredSize(Size) GetPreferredSize(Size) GetPreferredSize(Size) GetPreferredSize(Size)

Retrieves the size of a rectangular area into which a control can be fitted.

GetService(Type) GetService(Type) GetService(Type) GetService(Type)

Returns an object that represents a service provided by the Component or by its Container.

(Inherited from Component)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
Invalidate() Invalidate() Invalidate() Invalidate()

Invalidates the entire surface of the ToolStripItem and causes it to be redrawn.

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

(Inherited from ToolStripItem)
IsInputChar(Char) IsInputChar(Char) IsInputChar(Char) IsInputChar(Char)

Determines whether a character is an input character that the item recognizes.

(Inherited from ToolStripItem)
IsInputKey(Keys) IsInputKey(Keys) IsInputKey(Keys) IsInputKey(Keys)

Determines whether the specified key is a regular input key or a special key that requires preprocessing.

(Inherited from ToolStripItem)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
OnAvailableChanged(EventArgs) OnAvailableChanged(EventArgs) OnAvailableChanged(EventArgs) OnAvailableChanged(EventArgs)

Raises the AvailableChanged event.

(Inherited from ToolStripItem)
OnBackColorChanged(EventArgs) OnBackColorChanged(EventArgs) OnBackColorChanged(EventArgs) OnBackColorChanged(EventArgs)

Raises the BackColorChanged event.

(Inherited from ToolStripItem)
OnBoundsChanged() OnBoundsChanged() OnBoundsChanged() OnBoundsChanged()

Occurs when the Bounds property changes.

OnClick(EventArgs) OnClick(EventArgs) OnClick(EventArgs) OnClick(EventArgs)

Raises the Click event.

(Inherited from ToolStripItem)
OnDisplayStyleChanged(EventArgs) OnDisplayStyleChanged(EventArgs) OnDisplayStyleChanged(EventArgs) OnDisplayStyleChanged(EventArgs)

Raises the DisplayStyleChanged event.

(Inherited from ToolStripItem)
OnDoubleClick(EventArgs) OnDoubleClick(EventArgs) OnDoubleClick(EventArgs) OnDoubleClick(EventArgs)

Raises the DoubleClick event.

(Inherited from ToolStripItem)
OnDragDrop(DragEventArgs) OnDragDrop(DragEventArgs) OnDragDrop(DragEventArgs) OnDragDrop(DragEventArgs)

Raises the DragDrop event.

(Inherited from ToolStripItem)
OnDragEnter(DragEventArgs) OnDragEnter(DragEventArgs) OnDragEnter(DragEventArgs) OnDragEnter(DragEventArgs)

Raises the DragEnter event.

(Inherited from ToolStripItem)
OnDragLeave(EventArgs) OnDragLeave(EventArgs) OnDragLeave(EventArgs) OnDragLeave(EventArgs)

Raises the DragLeave event.

(Inherited from ToolStripItem)
OnDragOver(DragEventArgs) OnDragOver(DragEventArgs) OnDragOver(DragEventArgs) OnDragOver(DragEventArgs)

Raises the DragOver event.

(Inherited from ToolStripItem)
OnEnabledChanged(EventArgs) OnEnabledChanged(EventArgs) OnEnabledChanged(EventArgs) OnEnabledChanged(EventArgs)

Raises the EnabledChanged event.

(Inherited from ToolStripItem)
OnEnter(EventArgs) OnEnter(EventArgs) OnEnter(EventArgs) OnEnter(EventArgs)

Raises the Enter event.

OnFontChanged(EventArgs) OnFontChanged(EventArgs) OnFontChanged(EventArgs) OnFontChanged(EventArgs)

Raises the FontChanged event.

(Inherited from ToolStripItem)
OnForeColorChanged(EventArgs) OnForeColorChanged(EventArgs) OnForeColorChanged(EventArgs) OnForeColorChanged(EventArgs)

Raises the ForeColorChanged event.

(Inherited from ToolStripItem)
OnGiveFeedback(GiveFeedbackEventArgs) OnGiveFeedback(GiveFeedbackEventArgs) OnGiveFeedback(GiveFeedbackEventArgs) OnGiveFeedback(GiveFeedbackEventArgs)

Raises the GiveFeedback event.

(Inherited from ToolStripItem)
OnGotFocus(EventArgs) OnGotFocus(EventArgs) OnGotFocus(EventArgs) OnGotFocus(EventArgs)

Raises the GotFocus event.

OnHostedControlResize(EventArgs) OnHostedControlResize(EventArgs) OnHostedControlResize(EventArgs) OnHostedControlResize(EventArgs)

Synchronizes the resizing of the control host with the resizing of the hosted control.

OnKeyDown(KeyEventArgs) OnKeyDown(KeyEventArgs) OnKeyDown(KeyEventArgs) OnKeyDown(KeyEventArgs)

Raises the KeyDown event.

OnKeyPress(KeyPressEventArgs) OnKeyPress(KeyPressEventArgs) OnKeyPress(KeyPressEventArgs) OnKeyPress(KeyPressEventArgs)

Raises the KeyPress event.

OnKeyUp(KeyEventArgs) OnKeyUp(KeyEventArgs) OnKeyUp(KeyEventArgs) OnKeyUp(KeyEventArgs)

Raises the KeyUp event.

OnLayout(LayoutEventArgs) OnLayout(LayoutEventArgs) OnLayout(LayoutEventArgs) OnLayout(LayoutEventArgs)

Raises the Layout event.

OnLeave(EventArgs) OnLeave(EventArgs) OnLeave(EventArgs) OnLeave(EventArgs)

Raises the Leave event.

OnLocationChanged(EventArgs) OnLocationChanged(EventArgs) OnLocationChanged(EventArgs) OnLocationChanged(EventArgs)

Raises the LocationChanged event.

(Inherited from ToolStripItem)
OnLostFocus(EventArgs) OnLostFocus(EventArgs) OnLostFocus(EventArgs) OnLostFocus(EventArgs)

Raises the LostFocus event.

OnMouseDown(MouseEventArgs) OnMouseDown(MouseEventArgs) OnMouseDown(MouseEventArgs) OnMouseDown(MouseEventArgs)

Raises the MouseDown event.

(Inherited from ToolStripItem)
OnMouseEnter(EventArgs) OnMouseEnter(EventArgs) OnMouseEnter(EventArgs) OnMouseEnter(EventArgs)

Raises the MouseEnter event.

(Inherited from ToolStripItem)
OnMouseHover(EventArgs) OnMouseHover(EventArgs) OnMouseHover(EventArgs) OnMouseHover(EventArgs)

Raises the MouseHover event.

(Inherited from ToolStripItem)
OnMouseLeave(EventArgs) OnMouseLeave(EventArgs) OnMouseLeave(EventArgs) OnMouseLeave(EventArgs)

Raises the MouseLeave event.

(Inherited from ToolStripItem)
OnMouseMove(MouseEventArgs) OnMouseMove(MouseEventArgs) OnMouseMove(MouseEventArgs) OnMouseMove(MouseEventArgs)

Raises the MouseMove event.

(Inherited from ToolStripItem)
OnMouseUp(MouseEventArgs) OnMouseUp(MouseEventArgs) OnMouseUp(MouseEventArgs) OnMouseUp(MouseEventArgs)

Raises the MouseUp event.

(Inherited from ToolStripItem)
OnOwnerChanged(EventArgs) OnOwnerChanged(EventArgs) OnOwnerChanged(EventArgs) OnOwnerChanged(EventArgs)

Raises the OwnerChanged event.

(Inherited from ToolStripItem)
OnOwnerFontChanged(EventArgs) OnOwnerFontChanged(EventArgs) OnOwnerFontChanged(EventArgs) OnOwnerFontChanged(EventArgs)

Raises the FontChanged event when the Font property has changed on the parent of the ToolStripItem.

(Inherited from ToolStripItem)
OnPaint(PaintEventArgs) OnPaint(PaintEventArgs) OnPaint(PaintEventArgs) OnPaint(PaintEventArgs)

Raises the Paint event.

OnParentBackColorChanged(EventArgs) OnParentBackColorChanged(EventArgs) OnParentBackColorChanged(EventArgs) OnParentBackColorChanged(EventArgs)

Raises the BackColorChanged event.

(Inherited from ToolStripItem)
OnParentChanged(ToolStrip, ToolStrip) OnParentChanged(ToolStrip, ToolStrip) OnParentChanged(ToolStrip, ToolStrip) OnParentChanged(ToolStrip, ToolStrip)

Raises the ParentChanged event.

OnParentEnabledChanged(EventArgs) OnParentEnabledChanged(EventArgs) OnParentEnabledChanged(EventArgs) OnParentEnabledChanged(EventArgs)

Raises the EnabledChanged event when the Enabled property value of the item's container changes.

(Inherited from ToolStripItem)
OnParentForeColorChanged(EventArgs) OnParentForeColorChanged(EventArgs) OnParentForeColorChanged(EventArgs) OnParentForeColorChanged(EventArgs)

Raises the ForeColorChanged event.

(Inherited from ToolStripItem)
OnParentRightToLeftChanged(EventArgs) OnParentRightToLeftChanged(EventArgs) OnParentRightToLeftChanged(EventArgs) OnParentRightToLeftChanged(EventArgs)

Raises the RightToLeftChanged event.

(Inherited from ToolStripItem)
OnQueryContinueDrag(QueryContinueDragEventArgs) OnQueryContinueDrag(QueryContinueDragEventArgs) OnQueryContinueDrag(QueryContinueDragEventArgs) OnQueryContinueDrag(QueryContinueDragEventArgs)

Raises the QueryContinueDrag event.

(Inherited from ToolStripItem)
OnRightToLeftChanged(EventArgs) OnRightToLeftChanged(EventArgs) OnRightToLeftChanged(EventArgs) OnRightToLeftChanged(EventArgs)

Raises the RightToLeftChanged event.

(Inherited from ToolStripItem)
OnSubscribeControlEvents(Control) OnSubscribeControlEvents(Control) OnSubscribeControlEvents(Control) OnSubscribeControlEvents(Control)

Subscribes events from the hosted control.

OnTextChanged(EventArgs) OnTextChanged(EventArgs) OnTextChanged(EventArgs) OnTextChanged(EventArgs)

Raises the TextChanged event.

(Inherited from ToolStripItem)
OnUnsubscribeControlEvents(Control) OnUnsubscribeControlEvents(Control) OnUnsubscribeControlEvents(Control) OnUnsubscribeControlEvents(Control)

Unsubscribes events from the hosted control.

OnValidated(EventArgs) OnValidated(EventArgs) OnValidated(EventArgs) OnValidated(EventArgs)

Raises the Validated event.

OnValidating(CancelEventArgs) OnValidating(CancelEventArgs) OnValidating(CancelEventArgs) OnValidating(CancelEventArgs)

Raises the Validating event.

OnVisibleChanged(EventArgs) OnVisibleChanged(EventArgs) OnVisibleChanged(EventArgs) OnVisibleChanged(EventArgs)

Raises the VisibleChanged event.

(Inherited from ToolStripItem)
PerformClick() PerformClick() PerformClick() PerformClick()

Generates a Click event for a ToolStripItem.

(Inherited from ToolStripItem)
ProcessCmdKey(Message, Keys) ProcessCmdKey(Message, Keys) ProcessCmdKey(Message, Keys) ProcessCmdKey(Message, Keys)

Processes a command key.

ProcessDialogKey(Keys) ProcessDialogKey(Keys) ProcessDialogKey(Keys) ProcessDialogKey(Keys)

Processes a dialog key.

ProcessMnemonic(Char) ProcessMnemonic(Char) ProcessMnemonic(Char) ProcessMnemonic(Char)

Processes a mnemonic character.

ResetBackColor() ResetBackColor() ResetBackColor() ResetBackColor()

This method is not relevant to this class.

ResetDisplayStyle() ResetDisplayStyle() ResetDisplayStyle() ResetDisplayStyle()

This method is not relevant to this class.

(Inherited from ToolStripItem)
ResetFont() ResetFont() ResetFont() ResetFont()

This method is not relevant to this class.

(Inherited from ToolStripItem)
ResetForeColor() ResetForeColor() ResetForeColor() ResetForeColor()

This method is not relevant to this class.

ResetImage() ResetImage() ResetImage() ResetImage()

This method is not relevant to this class.

(Inherited from ToolStripItem)
ResetMargin() ResetMargin() ResetMargin() ResetMargin()

This method is not relevant to this class.

(Inherited from ToolStripItem)
ResetPadding() ResetPadding() ResetPadding() ResetPadding()

This method is not relevant to this class.

(Inherited from ToolStripItem)
ResetRightToLeft() ResetRightToLeft() ResetRightToLeft() ResetRightToLeft()

This method is not relevant to this class.

(Inherited from ToolStripItem)
ResetTextDirection() ResetTextDirection() ResetTextDirection() ResetTextDirection()

This method is not relevant to this class.

(Inherited from ToolStripItem)
Select() Select() Select() Select()

Selects the item.

(Inherited from ToolStripItem)
SetBounds(Rectangle) SetBounds(Rectangle) SetBounds(Rectangle) SetBounds(Rectangle)

Sets the size and location of the item.

(Inherited from ToolStripItem)
SetVisibleCore(Boolean) SetVisibleCore(Boolean) SetVisibleCore(Boolean) SetVisibleCore(Boolean)

Sets the ToolStripItem to the specified visible state.

ToString() ToString() ToString() ToString()

Returns a String containing the name of the Component, if any. This method should not be overridden.

(Inherited from ToolStripItem)

Events

AvailableChanged AvailableChanged AvailableChanged AvailableChanged

Occurs when the value of the Available property changes.

(Inherited from ToolStripItem)
BackColorChanged BackColorChanged BackColorChanged BackColorChanged

Occurs when the value of the BackColor property changes.

(Inherited from ToolStripItem)
Click Click Click Click

Occurs when the ToolStripItem is clicked.

(Inherited from ToolStripItem)
DisplayStyleChanged DisplayStyleChanged DisplayStyleChanged DisplayStyleChanged

This event is not relevant to this class.

Disposed Disposed Disposed Disposed

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

(Inherited from Component)
DoubleClick DoubleClick DoubleClick DoubleClick

Occurs when the item is double-clicked with the mouse.

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

(Inherited from ToolStripItem)
DragEnter DragEnter DragEnter DragEnter

Occurs when the user drags an item into the client area of this item.

(Inherited from ToolStripItem)
DragLeave DragLeave DragLeave DragLeave

Occurs when the user drags an item and the mouse pointer is no longer over the client area of this item.

(Inherited from ToolStripItem)
DragOver DragOver DragOver DragOver

Occurs when the user drags an item over the client area of this item.

(Inherited from ToolStripItem)
EnabledChanged EnabledChanged EnabledChanged EnabledChanged

Occurs when the Enabled property value has changed.

(Inherited from ToolStripItem)
Enter Enter Enter Enter

Occurs when the hosted control is entered.

ForeColorChanged ForeColorChanged ForeColorChanged ForeColorChanged

Occurs when the ForeColor property value changes.

(Inherited from ToolStripItem)
GiveFeedback GiveFeedback GiveFeedback GiveFeedback

Occurs during a drag operation.

(Inherited from ToolStripItem)
GotFocus GotFocus GotFocus GotFocus

Occurs when the hosted control receives focus.

KeyDown KeyDown KeyDown KeyDown

Occurs when a key is pressed and held down while the hosted control has focus.

KeyPress KeyPress KeyPress KeyPress

Occurs when a key is pressed while the hosted control has focus.

KeyUp KeyUp KeyUp KeyUp

Occurs when a key is released while the hosted control has focus.

Leave Leave Leave Leave

Occurs when the input focus leaves the hosted control.

LocationChanged LocationChanged LocationChanged LocationChanged

Occurs when the location of a ToolStripItem is updated.

(Inherited from ToolStripItem)
LostFocus LostFocus LostFocus LostFocus

Occurs when the hosted control loses focus.

MouseDown MouseDown MouseDown MouseDown

Occurs when the mouse pointer is over the item and a mouse button is pressed.

(Inherited from ToolStripItem)
MouseEnter MouseEnter MouseEnter MouseEnter

Occurs when the mouse pointer enters the item.

(Inherited from ToolStripItem)
MouseHover MouseHover MouseHover MouseHover

Occurs when the mouse pointer hovers over the item.

(Inherited from ToolStripItem)
MouseLeave MouseLeave MouseLeave MouseLeave

Occurs when the mouse pointer leaves the item.

(Inherited from ToolStripItem)
MouseMove MouseMove MouseMove MouseMove

Occurs when the mouse pointer is moved over the item.

(Inherited from ToolStripItem)
MouseUp MouseUp MouseUp MouseUp

Occurs when the mouse pointer is over the item and a mouse button is released.

(Inherited from ToolStripItem)
OwnerChanged OwnerChanged OwnerChanged OwnerChanged

Occurs when the Owner property changes.

(Inherited from ToolStripItem)
Paint Paint Paint Paint

Occurs when the item is redrawn.

(Inherited from ToolStripItem)
QueryAccessibilityHelp QueryAccessibilityHelp QueryAccessibilityHelp QueryAccessibilityHelp

Occurs when an accessibility client application invokes help for the ToolStripItem.

(Inherited from ToolStripItem)
QueryContinueDrag QueryContinueDrag QueryContinueDrag QueryContinueDrag

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)
RightToLeftChanged RightToLeftChanged RightToLeftChanged RightToLeftChanged

Occurs when the RightToLeft property value changes.

(Inherited from ToolStripItem)
TextChanged TextChanged TextChanged TextChanged

Occurs when the value of the Text property changes.

(Inherited from ToolStripItem)
Validated Validated Validated Validated

Occurs after the hosted control has been successfully validated.

Validating Validating Validating Validating

Occurs while the hosted control is validating.

VisibleChanged VisibleChanged VisibleChanged VisibleChanged

Occurs when the value of the Visible property changes.

(Inherited from ToolStripItem)

Explicit Interface Implementations

IDropTarget.OnDragDrop(DragEventArgs) IDropTarget.OnDragDrop(DragEventArgs) IDropTarget.OnDragDrop(DragEventArgs) IDropTarget.OnDragDrop(DragEventArgs)

Raises the DragDrop event.

(Inherited from ToolStripItem)
IDropTarget.OnDragEnter(DragEventArgs) IDropTarget.OnDragEnter(DragEventArgs) IDropTarget.OnDragEnter(DragEventArgs) IDropTarget.OnDragEnter(DragEventArgs)

Raises the DragEnter event.

(Inherited from ToolStripItem)
IDropTarget.OnDragLeave(EventArgs) IDropTarget.OnDragLeave(EventArgs) IDropTarget.OnDragLeave(EventArgs) IDropTarget.OnDragLeave(EventArgs)

Raises the DragLeave event.

(Inherited from ToolStripItem)
IDropTarget.OnDragOver(DragEventArgs) IDropTarget.OnDragOver(DragEventArgs) IDropTarget.OnDragOver(DragEventArgs) IDropTarget.OnDragOver(DragEventArgs)

Raises the DragOver event.

(Inherited from ToolStripItem)

Applies to