次の方法で共有


ToolboxItemCollection コンストラクタ (ToolboxItem )

指定したツールボックス項目の配列を使用して、ToolboxItemCollection クラスの新しいインスタンスを初期化します。

名前空間: System.Drawing.Design
アセンブリ: System.Drawing (system.drawing.dll 内)

構文

'宣言
Public Sub New ( _
    value As ToolboxItem() _
)
'使用
Dim value As ToolboxItem()

Dim instance As New ToolboxItemCollection(value)
public ToolboxItemCollection (
    ToolboxItem[] value
)
public:
ToolboxItemCollection (
    array<ToolboxItem^>^ value
)
public ToolboxItemCollection (
    ToolboxItem[] value
)
public function ToolboxItemCollection (
    value : ToolboxItem[]
)

パラメータ

  • value
    コレクションに格納するツールボックス項目を格納している ToolboxItem 型の配列。

使用例

次に示すのは、ToolboxItem オブジェクトの配列を使用して初期化した新しい ToolboxItemCollection インスタンスを作成するコード例です。

' 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))})
// 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.
array<ToolboxItem^>^temp0 = {gcnew ToolboxItem( System::Windows::Forms::Label::typeid ),gcnew ToolboxItem( System::Windows::Forms::TextBox::typeid )};
ToolboxItemCollection^ collection = gcnew ToolboxItemCollection( temp0 );

プラットフォーム

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1、1.0

参照

関連項目

ToolboxItemCollection クラス
ToolboxItemCollection メンバ
System.Drawing.Design 名前空間