ToolboxItemCollection 构造函数

定义

初始化 ToolboxItemCollection 类的新实例。

重载

ToolboxItemCollection(ToolboxItem[])

使用指定的工具箱项数组初始化 ToolboxItemCollection 类的新实例。

ToolboxItemCollection(ToolboxItemCollection)

使用指定的集合初始化 ToolboxItemCollection 类的新实例。

ToolboxItemCollection(ToolboxItem[])

使用指定的工具箱项数组初始化 ToolboxItemCollection 类的新实例。

public:
 ToolboxItemCollection(cli::array <System::Drawing::Design::ToolboxItem ^> ^ value);
public ToolboxItemCollection (System.Drawing.Design.ToolboxItem[] value);
new System.Drawing.Design.ToolboxItemCollection : System.Drawing.Design.ToolboxItem[] -> System.Drawing.Design.ToolboxItemCollection
Public Sub New (value As ToolboxItem())

参数

value
ToolboxItem[]

ToolboxItem 类型的数组,其中包含用以填充集合的工具箱项。

示例

下面的代码示例演示如何创建使用 对象数组ToolboxItem初始化的新ToolboxItemCollection实例。

// Create a new ToolboxItemCollection using a ToolboxItem array.
array<ToolboxItem^>^temp0 = {gcnew ToolboxItem( System::Windows::Forms::Label::typeid ),gcnew ToolboxItem( System::Windows::Forms::TextBox::typeid )};
ToolboxItemCollection^ collection = gcnew ToolboxItemCollection( temp0 );
// Create a new ToolboxItemCollection using a ToolboxItem array.
ToolboxItemCollection collection = 
    new ToolboxItemCollection( new ToolboxItem[] { 
        new ToolboxItem(typeof(System.Windows.Forms.Label)),
        new ToolboxItem(typeof(System.Windows.Forms.TextBox)) } );
' Create a new ToolboxItemCollection using a ToolboxItem array.
Dim collection As New ToolboxItemCollection(New ToolboxItem() _
 {New ToolboxItem(GetType(System.Windows.Forms.Label)), _
  New ToolboxItem(GetType(System.Windows.Forms.TextBox))})

适用于

ToolboxItemCollection(ToolboxItemCollection)

使用指定的集合初始化 ToolboxItemCollection 类的新实例。

public:
 ToolboxItemCollection(System::Drawing::Design::ToolboxItemCollection ^ value);
public ToolboxItemCollection (System.Drawing.Design.ToolboxItemCollection value);
new System.Drawing.Design.ToolboxItemCollection : System.Drawing.Design.ToolboxItemCollection -> System.Drawing.Design.ToolboxItemCollection
Public Sub New (value As ToolboxItemCollection)

参数

value
ToolboxItemCollection

用以填充新集合的 ToolboxItemCollection

示例

下面的代码示例演示如何创建使用另一ToolboxItemCollection个 初始化的新ToolboxItemCollection实例。

// Create a new ToolboxItemCollection using an existing ToolboxItemCollection.
ToolboxItemCollection^ coll = gcnew ToolboxItemCollection( collection );
// Create a new ToolboxItemCollection using an existing ToolboxItemCollection.
ToolboxItemCollection coll =
    new ToolboxItemCollection( collection );
' Creates a new ToolboxItemCollection using an existing ToolboxItemCollection.
Dim coll As New ToolboxItemCollection(collection)

适用于