ToolStripItem::Owner Property
.NET Framework (current version)
Gets or sets the owner of this item.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
public: [BrowsableAttribute(false)] property ToolStrip^ Owner { ToolStrip^ get(); void set(ToolStrip^ value); }
Property Value
Type: System.Windows.Forms::ToolStrip^The ToolStrip that owns or is to own the ToolStripItem.
Owner returns the ToolStrip whose Items collection contains the current ToolStripItem. This is the best way to reference ImageList or other properties in the top-level ToolStrip without writing special code to handle overflow.
The Owner remains the same even if the item falls into the ToolStripOverflow. The Owner can be null for certain elements that are in the DisplayedItems collection but not in the Items collection.
The following code example demonstrates how to use the Owner property for custom rendering. This code example is part of a larger example provided for the ToolStripItem class.
.NET Framework
Available since 2.0
Available since 2.0
Show: