StatusBar.Text プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文
[LocalizableAttribute(true)] public: virtual property String^ Text { String^ get () override; void set (String^ value) override; }
StatusBar コントロールに関連付けられたテキスト。
使用例
Text プロパティを使用する方法を次のコード例に示します。この例を実行するには、次のコードをフォームに貼り付けます。そして、フォームのコンストラクタまたは Load メソッドで InitializeSimpleStatusBar メソッドを呼び出します。
' Initialize a single-panel status bar. This is done ' by setting the Text property and setting ShowPanels to False. Private Sub InitializeSimpleStatusBar() ' Declare the StatusBar control Dim simpleStatusBar As New StatusBar ' Set the ShowPanels property to False. simpleStatusBar.ShowPanels = False ' Set the text. simpleStatusBar.Text = "This is a single-panel status bar" ' Set the width and anchor the StatusBar simpleStatusBar.Width = 200 simpleStatusBar.Anchor = AnchorStyles.Top ' Add the StatusBar to the form. Me.Controls.Add(simpleStatusBar) End Sub
// Initialize a single-panel status bar. This is done // by setting the Text property and setting ShowPanels to False. private void InitializeSimpleStatusBar() { // Declare the StatusBar control StatusBar simpleStatusBar = new StatusBar(); // Set the ShowPanels property to False. simpleStatusBar.ShowPanels = false; // Set the text. simpleStatusBar.Text = "This is a single-panel status bar"; // Set the width and anchor the StatusBar simpleStatusBar.Width = 200; simpleStatusBar.Anchor = AnchorStyles.Top; // Add the StatusBar to the form. this.Controls.Add(simpleStatusBar); }
// Initialize a single-panel status bar. This is done // by setting the Text property and setting ShowPanels to False. private: void InitializeSimpleStatusBar() { // Declare the StatusBar control StatusBar^ simpleStatusBar = gcnew StatusBar; // Set the ShowPanels property to False. simpleStatusBar->ShowPanels = false; // Set the text. simpleStatusBar->Text = "This is a single-panel status bar"; // Set the width and anchor the StatusBar simpleStatusBar->Width = 200; simpleStatusBar->Anchor = AnchorStyles::Top; // Add the StatusBar to the form. this->Controls->Add( simpleStatusBar ); }
// Initialize a single-panel status bar. This is done // by setting the Text property and setting ShowPanels to False. private void InitializeSimpleStatusBar() { // Declare the StatusBar control StatusBar simpleStatusBar = new StatusBar(); // Set the ShowPanels property to False. simpleStatusBar.set_ShowPanels(false); // Set the text. simpleStatusBar.set_Text("This is a single-panel status bar"); // Set the width and anchor the StatusBar simpleStatusBar.set_Width(200); simpleStatusBar.set_Anchor(AnchorStyles.Top); // Add the StatusBar to the form. this.get_Controls().Add(simpleStatusBar); } //InitializeSimpleStatusBar
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- StatusBar.Text プロパティのページへのリンク