ToolStripItemCollection.Add ToolStripItemCollection.Add ToolStripItemCollection.Add ToolStripItemCollection.Add Method

Definition

Adds a ToolStripItem to the collection.

Overloads

Add(Image) Add(Image) Add(Image)

Adds a ToolStripItem that displays the specified image to the collection.

Add(String) Add(String) Add(String) Add(String)

Adds a ToolStripItem that displays the specified text to the collection.

Add(ToolStripItem) Add(ToolStripItem) Add(ToolStripItem) Add(ToolStripItem)

Adds the specified item to the end of the collection.

Add(String, Image) Add(String, Image) Add(String, Image)

Adds a ToolStripItem that displays the specified image and text to the collection.

Add(String, Image, EventHandler) Add(String, Image, EventHandler) Add(String, Image, EventHandler)

Adds a ToolStripItem that displays the specified image and text to the collection and that raises the Click event.

Add(Image) Add(Image) Add(Image)

Adds a ToolStripItem that displays the specified image to the collection.

public:
 System::Windows::Forms::ToolStripItem ^ Add(System::Drawing::Image ^ image);
public System.Windows.Forms.ToolStripItem Add (System.Drawing.Image image);
member this.Add : System.Drawing.Image -> System.Windows.Forms.ToolStripItem

Parameters

image
Image Image Image Image

The Image to be displayed on the ToolStripItem.

Returns

Add(String) Add(String) Add(String) Add(String)

Adds a ToolStripItem that displays the specified text to the collection.

public:
 System::Windows::Forms::ToolStripItem ^ Add(System::String ^ text);
public System.Windows.Forms.ToolStripItem Add (string text);
member this.Add : string -> System.Windows.Forms.ToolStripItem
Public Function Add (text As String) As ToolStripItem

Parameters

text
String String String String

The text to be displayed on the ToolStripItem.

Returns

Add(ToolStripItem) Add(ToolStripItem) Add(ToolStripItem) Add(ToolStripItem)

Adds the specified item to the end of the collection.

public:
 int Add(System::Windows::Forms::ToolStripItem ^ value);
public int Add (System.Windows.Forms.ToolStripItem value);
member this.Add : System.Windows.Forms.ToolStripItem -> int
Public Function Add (value As ToolStripItem) As Integer

Parameters

value
ToolStripItem ToolStripItem ToolStripItem ToolStripItem

The ToolStripItem to add to the end of the collection.

Returns

An Int32 representing the zero-based index of the new item in the collection.

Exceptions

Add(String, Image) Add(String, Image) Add(String, Image)

Adds a ToolStripItem that displays the specified image and text to the collection.

public:
 System::Windows::Forms::ToolStripItem ^ Add(System::String ^ text, System::Drawing::Image ^ image);
public System.Windows.Forms.ToolStripItem Add (string text, System.Drawing.Image image);
member this.Add : string * System.Drawing.Image -> System.Windows.Forms.ToolStripItem

Parameters

text
String String String String

The text to be displayed on the ToolStripItem.

image
Image Image Image Image

The Image to be displayed on the ToolStripItem.

Returns

Add(String, Image, EventHandler) Add(String, Image, EventHandler) Add(String, Image, EventHandler)

Adds a ToolStripItem that displays the specified image and text to the collection and that raises the Click event.

public:
 System::Windows::Forms::ToolStripItem ^ Add(System::String ^ text, System::Drawing::Image ^ image, EventHandler ^ onClick);
public System.Windows.Forms.ToolStripItem Add (string text, System.Drawing.Image image, EventHandler onClick);
member this.Add : string * System.Drawing.Image * EventHandler -> System.Windows.Forms.ToolStripItem

Parameters

text
String String String String

The text to be displayed on the ToolStripItem.

image
Image Image Image Image

The Image to be displayed on the ToolStripItem.

Returns

Applies to