ToolStripControlHost.Text プロパティとは? わかりやすく解説

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

ToolStripControlHost.Text プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

ホストされるコントロール表示されるテキスト取得または設定します

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

使用例使用例

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 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からToolStripControlHost.Text プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からToolStripControlHost.Text プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からToolStripControlHost.Text プロパティ を検索

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

辞書ショートカット

すべての辞書の索引

ToolStripControlHost.Text プロパティのお隣キーワード
検索ランキング

   

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



ToolStripControlHost.Text プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS