ToolStripItem Constructors

Definition

Initializes a new instance of the ToolStripItem class.

Overloads

ToolStripItem()

Initializes a new instance of the ToolStripItem class.

ToolStripItem(String, Image, EventHandler)

Initializes a new instance of the ToolStripItem class with the specified name, image, and event handler.

ToolStripItem(String, Image, EventHandler, String)

Initializes a new instance of the ToolStripItem class with the specified display text, image, event handler, and name.

ToolStripItem()

Source:
ToolStripItem.cs
Source:
ToolStripItem.cs
Source:
ToolStripItem.cs

Initializes a new instance of the ToolStripItem class.

C#
protected ToolStripItem();

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

ToolStripItem(String, Image, EventHandler)

Source:
ToolStripItem.cs
Source:
ToolStripItem.cs
Source:
ToolStripItem.cs

Initializes a new instance of the ToolStripItem class with the specified name, image, and event handler.

C#
protected ToolStripItem(string text, System.Drawing.Image image, EventHandler onClick);
C#
protected ToolStripItem(string? text, System.Drawing.Image? image, EventHandler? onClick);

Parameters

text
String

A String representing the name of the ToolStripItem.

image
Image

The Image to display on the ToolStripItem.

onClick
EventHandler

Raises the Click event when the user clicks the ToolStripItem.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

ToolStripItem(String, Image, EventHandler, String)

Source:
ToolStripItem.cs
Source:
ToolStripItem.cs
Source:
ToolStripItem.cs

Initializes a new instance of the ToolStripItem class with the specified display text, image, event handler, and name.

C#
protected ToolStripItem(string text, System.Drawing.Image image, EventHandler onClick, string name);
C#
protected ToolStripItem(string? text, System.Drawing.Image? image, EventHandler? onClick, string? name);

Parameters

text
String

The text to display on the ToolStripItem.

image
Image

The Image to display on the ToolStripItem.

onClick
EventHandler

The event handler for the Click event.

name
String

The name of the ToolStripItem.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9