ToolStripItemCollection.Add Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds a ToolStripItem to the collection.
Add(Image) |
Adds a ToolStripItem that displays the specified image to the collection. |
Add(String) |
Adds a ToolStripItem that displays the specified text to the collection. |
Add(ToolStripItem) |
Adds the specified item to the end of the collection. |
Add(String, Image) |
Adds a ToolStripItem that displays the specified image and text to the collection. |
Add(String, Image, EventHandler) |
Adds a ToolStripItem that displays the specified image and text to the collection and that raises the Click event. |
- Source:
- ToolStripItemCollection.cs
- Source:
- ToolStripItemCollection.cs
- Source:
- ToolStripItemCollection.cs
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);
public System.Windows.Forms.ToolStripItem Add (System.Drawing.Image? image);
member this.Add : System.Drawing.Image -> System.Windows.Forms.ToolStripItem
Public Function Add (image As Image) As ToolStripItem
Parameters
- image
- Image
The Image to be displayed on the ToolStripItem.
Returns
The new ToolStripItem.
Applies to
.NET Framework 4.8.1 и други версии
Продукт | Версии |
---|---|
.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 |
- Source:
- ToolStripItemCollection.cs
- Source:
- ToolStripItemCollection.cs
- Source:
- ToolStripItemCollection.cs
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);
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
The text to be displayed on the ToolStripItem.
Returns
The new ToolStripItem.
Applies to
.NET Framework 4.8.1 и други версии
Продукт | Версии |
---|---|
.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 |
- Source:
- ToolStripItemCollection.cs
- Source:
- ToolStripItemCollection.cs
- Source:
- ToolStripItemCollection.cs
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
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
The value
parameter is null
.
Applies to
.NET Framework 4.8.1 и други версии
Продукт | Версии |
---|---|
.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 |
- Source:
- ToolStripItemCollection.cs
- Source:
- ToolStripItemCollection.cs
- Source:
- ToolStripItemCollection.cs
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);
public System.Windows.Forms.ToolStripItem Add (string? text, System.Drawing.Image? image);
member this.Add : string * System.Drawing.Image -> System.Windows.Forms.ToolStripItem
Public Function Add (text As String, image As Image) As ToolStripItem
Parameters
- text
- String
The text to be displayed on the ToolStripItem.
- image
- Image
The Image to be displayed on the ToolStripItem.
Returns
The new ToolStripItem.
Applies to
.NET Framework 4.8.1 и други версии
Продукт | Версии |
---|---|
.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 |
- Source:
- ToolStripItemCollection.cs
- Source:
- ToolStripItemCollection.cs
- Source:
- ToolStripItemCollection.cs
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);
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
Public Function Add (text As String, image As Image, onClick As EventHandler) As ToolStripItem
Parameters
- text
- String
The text to be displayed on the ToolStripItem.
- image
- Image
The Image to be displayed on the ToolStripItem.
- onClick
- EventHandler
Raises the Click event.
Returns
The new ToolStripItem.
Applies to
.NET Framework 4.8.1 и други версии
Продукт | Версии |
---|---|
.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 |
Обратна връзка за .NET
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка: