ToolStripControlHost コンストラクタとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ToolStripControlHost コンストラクタの意味・解説 

ToolStripControlHost コンストラクタ (Control)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

指定したコントロールホストする ToolStripControlHost クラス新しインスタンス初期化します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Dim c As Control

Dim instance As New ToolStripControlHost(c)
public ToolStripControlHost (
    Control c
)
public:
ToolStripControlHost (
    Control^ c
)
public ToolStripControlHost (
    Control c
)
public function ToolStripControlHost (
    c : Control
)

パラメータ

c

この ToolStripControlHost クラスによってホストされる Control

例外例外
例外種類条件

ArgumentNullException

c パラメータによって参照されるコントロールnull 参照 (Visual Basic では Nothing) です。

使用例使用例

ToolStripControlHost コントロール構築し複数プロパティ設定するコード例次に示します。この例を実行するには、toolStrip1 という名前の ToolStrip が配置されているフォームコード貼り付けフォームコンストラクタまたは Load イベント ハンドラから InitializeDateTimePickerHost呼び出します。

Private dateTimePickerHost As ToolStripControlHost


Private Sub InitializeDateTimePickerHost()

    ' Create a new ToolStripControlHost, passing in a control.
    dateTimePickerHost = New ToolStripControlHost(New
 DateTimePicker())

    ' Set the font on the ToolStripControlHost, this will affect the
 hosted control.
    dateTimePickerHost.Font = New Font("Arial",
 7.0F, FontStyle.Italic)

    ' Set the Width property, this will also affect the hosted control.
    dateTimePickerHost.Width = 100
    dateTimePickerHost.DisplayStyle = ToolStripItemDisplayStyle.Text

    ' Setting the Text property requires a string that converts to a
 
    ' DateTime type since that is what the hosted control requires.
    dateTimePickerHost.Text = "12/23/2005"

    ' Cast the Control property back to the original type to set a 
    ' type-specific property.
    CType(dateTimePickerHost.Control, DateTimePicker).Format = DateTimePickerFormat.Short

    ' Add the control host to the ToolStrip.
    toolStrip1.Items.Add(dateTimePickerHost)

End Sub
ToolStripControlHost dateTimePickerHost;

private void InitializeDateTimePickerHost()
{

    // Create a new ToolStripControlHost, passing in a control.
    dateTimePickerHost = new ToolStripControlHost(new
 DateTimePicker());

    // Set the font on the ToolStripControlHost, this will affect the
 hosted control.
    dateTimePickerHost.Font = new Font("Arial", 7.0F,
 FontStyle.Italic);

    // Set the Width property, this will also affect the hosted control.
    dateTimePickerHost.Width = 100;
    dateTimePickerHost.DisplayStyle = ToolStripItemDisplayStyle.Text;

    // Setting the Text property requires a string that converts to
 a 
    // DateTime type since that is what the hosted control requires.
    dateTimePickerHost.Text = "12/23/2005";

    // Cast the Control property back to the original type to set a
 
    // type-specific property.
    ((DateTimePicker)dateTimePickerHost.Control).Format = DateTimePickerFormat.Short;

    // Add the control host to the ToolStrip.
    toolStrip1.Items.Add(dateTimePickerHost);

}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ToolStripControlHost クラス
ToolStripControlHost メンバ
System.Windows.Forms 名前空間

ToolStripControlHost コンストラクタ (Control, String)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

指定したコントロールホストし、指定した名前を持つ ToolStripControlHost クラス新しインスタンス初期化します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Dim c As Control
Dim name As String

Dim instance As New ToolStripControlHost(c,
 name)
public ToolStripControlHost (
    Control c,
    string name
)
public:
ToolStripControlHost (
    Control^ c, 
    String^ name
)
public ToolStripControlHost (
    Control c, 
    String name
)
public function ToolStripControlHost (
    c : Control, 
    name : String
)

パラメータ

c

この ToolStripControlHost クラスによってホストされる Control

name

ToolStripControlHost の名前。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ToolStripControlHost クラス
ToolStripControlHost メンバ
System.Windows.Forms 名前空間

ToolStripControlHost コンストラクタ

ToolStripControlHost クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
ToolStripControlHost (Control) 指定したコントロールホストする ToolStripControlHost クラス新しインスタンス初期化します。
ToolStripControlHost (Control, String) 指定したコントロールホストし、指定した名前を持つ ToolStripControlHost クラス新しインスタンス初期化します。
参照参照

関連項目

ToolStripControlHost クラス
ToolStripControlHost メンバ
System.Windows.Forms 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ToolStripControlHost コンストラクタ」の関連用語

ToolStripControlHost コンストラクタのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ToolStripControlHost コンストラクタのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS