ToolStripControlHost.Text プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As ToolStripControlHost Dim value As String value = instance.Text instance.Text = value
public: virtual property String^ Text { String^ get () override; void set (String^ value) override; }
テキストを表す String。

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); }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からToolStripControlHost.Text プロパティを検索する場合は、下記のリンクをクリックしてください。

- ToolStripControlHost.Text プロパティのページへのリンク