StatusBarPanel イベント
StatusBarPanel クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


StatusBarPanel は、StatusBar コントロールの StatusBar.StatusBarPanelCollection に含まれる個別のパネルを表します。StatusBarPanel は、アプリケーションのステータスを反映するために使用できるテキストまたはアイコン (またはその両方) を格納できます。StatusBar コントロールの StatusBar.Panels プロパティを使用してアクセスできる StatusBar.StatusBarPanelCollection を使用して、個別の StatusBarPanel を取得、追加、または削除します。
StatusBarPanel には、StatusBar コントロール内のパネルの表示動作を変更できるプロパティが用意されています。Icon プロパティを使用すると、パネル内にアイコンを表示できます。このプロパティを使用して、アプリケーション内の状態をグラフィカル表示できます。Alignment プロパティを使用すると、パネル内でのテキストまたはアイコン (あるいはその両方) をどのように配置するかを指定できます。パネルのテキストに合わせてパネルのサイズが正しく設定されるようにするには、AutoSize プロパティを使用して、パネルのテキストに合わせるか、または StatusBar コントロールの残りの領域を埋めるように、パネルのサイズを自動的に変更できます。MinWidth プロパティを使用すると、パネルの最小幅を指定して、表示目的のデータよりもパネルが小さくならないようにすることができます。
StatusBar コントロールは、通常、アプリケーションに関するヘルプ情報やステータス情報を表示するために使用します。多くの場合、パネルに表示されるデータに関する追加情報を表示します。ToolTipText プロパティを使用すると、マウス ポインタがパネル上に配置されたときに、必ず情報が表示されるようにできます。
StatusBar コントロールは通常テキスト情報の表示に使用しますが、独自の種類の表示も StatusBarPanel に設定できます。Style プロパティを使用すると、StatusBarPanel をどのように描画するかを指定できます。既定では、Style プロパティを使用して、Text プロパティの値 (Icon プロパティで指定されている場合はアイコンも) が表示されます。プロパティを OwnerDraw に設定した場合は、パネルに独自の情報を描画できます。この機能を使用して、パネルにプログレス バーやアニメーション アイコンを描画できます。
StatusBarPanel クラスのインスタンスを作成すると、読み書き可能なプロパティが初期値に設定されます。これらの初期値の一覧については、StatusBarPanel コンストラクタのトピックを参照してください。

フォームに StatusBar コントロールを作成し、2 つの StatusBarPanel オブジェクトを追加するコード例を次に示します。panel1 という名前の一方の StatusBarPanel は、アプリケーションのステータスを表すテキストを表示します。panel2 という名前のもう一方の StatusBarPanel は、現在の日付を表示し、StatusBarPanel クラスの ToolTipText プロパティを使用して現在の時刻を表示します。この例では、標準パネルの代わりにこれらのパネルが表示されるようにするために ShowPanels プロパティを使用し、さらに Panels プロパティを使用して StatusBar.StatusBarPanelCollection の Add メソッドにアクセスして StatusBar にパネルを追加します。また、StatusBarPanel オブジェクトを初期化するために、AutoSize、BorderStyle、ToolTipText、Text の各プロパティも使用します。この例は、コード内で定義されたメソッドが定義されており、Form のコンストラクタから呼び出されることを前提にしています。
Private Sub CreateMyStatusBar() ' Create a StatusBar control. Dim statusBar1 As New StatusBar() ' Create two StatusBarPanel objects to display in the StatusBar. Dim panel1 As New StatusBarPanel() Dim panel2 As New StatusBarPanel() ' Display the first panel with a sunken border style. panel1.BorderStyle = StatusBarPanelBorderStyle.Sunken ' Initialize the text of the panel. panel1.Text = "Ready..." ' Set the AutoSize property to use all remaining space on the StatusBar. panel1.AutoSize = StatusBarPanelAutoSize.Spring ' Display the second panel with a raised border style. panel2.BorderStyle = StatusBarPanelBorderStyle.Raised ' Create ToolTip text that displays the time the application was started. panel2.ToolTipText = "Started: " & System.DateTime.Now.ToShortTimeString() ' Set the text of the panel to the current date. panel2.Text = System.DateTime.Today.ToLongDateString() ' Set the AutoSize property to size the panel to the size of the contents. panel2.AutoSize = StatusBarPanelAutoSize.Contents ' Display panels in the StatusBar control. statusBar1.ShowPanels = True ' Add both panels to the StatusBarPanelCollection of the StatusBar. statusBar1.Panels.Add(panel1) statusBar1.Panels.Add(panel2) ' Add the StatusBar to the form. Me.Controls.Add(statusBar1) End Sub
private void CreateMyStatusBar() { // Create a StatusBar control. StatusBar statusBar1 = new StatusBar(); // Create two StatusBarPanel objects to display in the StatusBar. StatusBarPanel panel1 = new StatusBarPanel(); StatusBarPanel panel2 = new StatusBarPanel(); // Display the first panel with a sunken border style. panel1.BorderStyle = StatusBarPanelBorderStyle.Sunken; // Initialize the text of the panel. panel1.Text = "Ready..."; // Set the AutoSize property to use all remaining space on the StatusBar. panel1.AutoSize = StatusBarPanelAutoSize.Spring; // Display the second panel with a raised border style. panel2.BorderStyle = StatusBarPanelBorderStyle.Raised; // Create ToolTip text that displays time the application was //started. panel2.ToolTipText = "Started: " + System.DateTime.Now.ToShortTimeString(); // Set the text of the panel to the current date. panel2.Text = System.DateTime.Today.ToLongDateString(); // Set the AutoSize property to size the panel to the size of the contents. panel2.AutoSize = StatusBarPanelAutoSize.Contents; // Display panels in the StatusBar control. statusBar1.ShowPanels = true; // Add both panels to the StatusBarPanelCollection of the StatusBar. statusBar1.Panels.Add(panel1); statusBar1.Panels.Add(panel2); // Add the StatusBar to the form. this.Controls.Add(statusBar1); }
private: void CreateMyStatusBar() { // Create a StatusBar control. StatusBar^ statusBar1 = gcnew StatusBar; // Create two StatusBarPanel objects to display in the StatusBar. StatusBarPanel^ panel1 = gcnew StatusBarPanel; StatusBarPanel^ panel2 = gcnew StatusBarPanel; // Display the first panel with a sunken border style. panel1->BorderStyle = StatusBarPanelBorderStyle::Sunken; // Initialize the text of the panel. panel1->Text = "Ready..."; // Set the AutoSize property to use all remaining space on the StatusBar. panel1->AutoSize = StatusBarPanelAutoSize::Spring; // Display the second panel with a raised border style. panel2->BorderStyle = StatusBarPanelBorderStyle::Raised; // Create ToolTip text that displays the time the application // was started. panel2->ToolTipText = System::DateTime::Now.ToShortTimeString(); // Set the text of the panel to the current date. panel2->Text = "Started: " + System::DateTime::Today.ToLongDateString(); // Set the AutoSize property to size the panel to the size of the contents. panel2->AutoSize = StatusBarPanelAutoSize::Contents; // Display panels in the StatusBar control. statusBar1->ShowPanels = true; // Add both panels to the StatusBarPanelCollection of the StatusBar. statusBar1->Panels->Add( panel1 ); statusBar1->Panels->Add( panel2 ); // Add the StatusBar to the form. this->Controls->Add( statusBar1 ); }
private void CreateMyStatusBar() { // Create a StatusBar control. StatusBar statusBar1 = new StatusBar(); // Create two StatusBarPanel objects to display in the StatusBar. StatusBarPanel panel1 = new StatusBarPanel(); StatusBarPanel panel2 = new StatusBarPanel(); // Display the first panel with a sunken border style. panel1.set_BorderStyle(StatusBarPanelBorderStyle.Sunken); // Initialize the text of the panel. panel1.set_Text("Ready..."); // Set the AutoSize property to use all remaining space on the StatusBar. panel1.set_AutoSize(StatusBarPanelAutoSize.Spring); // Display the second panel with a raised border style. panel2.set_BorderStyle(StatusBarPanelBorderStyle.Raised); // Create ToolTip text that displays the time the application was started. panel2.set_ToolTipText("Started: " + System.DateTime.get_Now().ToShortTimeString()); // Set the text of the panel to the current date. panel2.set_Text(System.DateTime.get_Today().ToLongDateString()); // Set the AutoSize property to size the panel to the size of the // contents. panel2.set_AutoSize(StatusBarPanelAutoSize.Contents); // Display panels in the StatusBar control. statusBar1.set_ShowPanels(true); // Add both panels to the StatusBarPanelCollection of the StatusBar. statusBar1.get_Panels().Add(panel1); statusBar1.get_Panels().Add(panel2); // Add the StatusBar to the form. this.get_Controls().Add(statusBar1); } //CreateMyStatusBar

System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.StatusBarPanel


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


StatusBarPanel コンストラクタ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


StatusBarPanel のインスタンスを作成すると、次の読み書き可能プロパティが初期値に設定されます。
AutoSize | None |
BorderStyle | |
null 参照 (Visual Basic では Nothing) | |
MinWidth | |
ToolTipText | |

フォームに StatusBar コントロールを作成し、2 つの StatusBarPanel オブジェクトを追加するコード例を次に示します。panel1 という名前の一方の StatusBarPanel は、アプリケーションのステータスを表すテキストを表示します。panel2 という名前のもう一方の StatusBarPanel は、現在の日付を表示し、StatusBarPanel クラスの ToolTipText プロパティを使用して現在の時刻を表示します。この例では、標準パネルの代わりにこれらのパネルが表示されるようにするために ShowPanels プロパティを使用し、さらに Panels プロパティを使用して StatusBar.StatusBarPanelCollection の Add メソッドにアクセスして StatusBar にパネルを追加します。また、StatusBarPanel オブジェクトを初期化するために、AutoSize、BorderStyle、ToolTipText、Text の各プロパティも使用します。この例は、コード内で定義されたメソッドが定義されており、Form のコンストラクタから呼び出されることを前提にしています。
Private Sub CreateMyStatusBar() ' Create a StatusBar control. Dim statusBar1 As New StatusBar() ' Create two StatusBarPanel objects to display in the StatusBar. Dim panel1 As New StatusBarPanel() Dim panel2 As New StatusBarPanel() ' Display the first panel with a sunken border style. panel1.BorderStyle = StatusBarPanelBorderStyle.Sunken ' Initialize the text of the panel. panel1.Text = "Ready..." ' Set the AutoSize property to use all remaining space on the StatusBar. panel1.AutoSize = StatusBarPanelAutoSize.Spring ' Display the second panel with a raised border style. panel2.BorderStyle = StatusBarPanelBorderStyle.Raised ' Create ToolTip text that displays the time the application was started. panel2.ToolTipText = "Started: " & System.DateTime.Now.ToShortTimeString() ' Set the text of the panel to the current date. panel2.Text = System.DateTime.Today.ToLongDateString() ' Set the AutoSize property to size the panel to the size of the contents. panel2.AutoSize = StatusBarPanelAutoSize.Contents ' Display panels in the StatusBar control. statusBar1.ShowPanels = True ' Add both panels to the StatusBarPanelCollection of the StatusBar. statusBar1.Panels.Add(panel1) statusBar1.Panels.Add(panel2) ' Add the StatusBar to the form. Me.Controls.Add(statusBar1) End Sub
private void CreateMyStatusBar() { // Create a StatusBar control. StatusBar statusBar1 = new StatusBar(); // Create two StatusBarPanel objects to display in the StatusBar. StatusBarPanel panel1 = new StatusBarPanel(); StatusBarPanel panel2 = new StatusBarPanel(); // Display the first panel with a sunken border style. panel1.BorderStyle = StatusBarPanelBorderStyle.Sunken; // Initialize the text of the panel. panel1.Text = "Ready..."; // Set the AutoSize property to use all remaining space on the StatusBar. panel1.AutoSize = StatusBarPanelAutoSize.Spring; // Display the second panel with a raised border style. panel2.BorderStyle = StatusBarPanelBorderStyle.Raised; // Create ToolTip text that displays time the application was //started. panel2.ToolTipText = "Started: " + System.DateTime.Now.ToShortTimeString(); // Set the text of the panel to the current date. panel2.Text = System.DateTime.Today.ToLongDateString(); // Set the AutoSize property to size the panel to the size of the contents. panel2.AutoSize = StatusBarPanelAutoSize.Contents; // Display panels in the StatusBar control. statusBar1.ShowPanels = true; // Add both panels to the StatusBarPanelCollection of the StatusBar. statusBar1.Panels.Add(panel1); statusBar1.Panels.Add(panel2); // Add the StatusBar to the form. this.Controls.Add(statusBar1); }
private: void CreateMyStatusBar() { // Create a StatusBar control. StatusBar^ statusBar1 = gcnew StatusBar; // Create two StatusBarPanel objects to display in the StatusBar. StatusBarPanel^ panel1 = gcnew StatusBarPanel; StatusBarPanel^ panel2 = gcnew StatusBarPanel; // Display the first panel with a sunken border style. panel1->BorderStyle = StatusBarPanelBorderStyle::Sunken; // Initialize the text of the panel. panel1->Text = "Ready..."; // Set the AutoSize property to use all remaining space on the StatusBar. panel1->AutoSize = StatusBarPanelAutoSize::Spring; // Display the second panel with a raised border style. panel2->BorderStyle = StatusBarPanelBorderStyle::Raised; // Create ToolTip text that displays the time the application // was started. panel2->ToolTipText = System::DateTime::Now.ToShortTimeString(); // Set the text of the panel to the current date. panel2->Text = "Started: " + System::DateTime::Today.ToLongDateString(); // Set the AutoSize property to size the panel to the size of the contents. panel2->AutoSize = StatusBarPanelAutoSize::Contents; // Display panels in the StatusBar control. statusBar1->ShowPanels = true; // Add both panels to the StatusBarPanelCollection of the StatusBar. statusBar1->Panels->Add( panel1 ); statusBar1->Panels->Add( panel2 ); // Add the StatusBar to the form. this->Controls->Add( statusBar1 ); }
private void CreateMyStatusBar() { // Create a StatusBar control. StatusBar statusBar1 = new StatusBar(); // Create two StatusBarPanel objects to display in the StatusBar. StatusBarPanel panel1 = new StatusBarPanel(); StatusBarPanel panel2 = new StatusBarPanel(); // Display the first panel with a sunken border style. panel1.set_BorderStyle(StatusBarPanelBorderStyle.Sunken); // Initialize the text of the panel. panel1.set_Text("Ready..."); // Set the AutoSize property to use all remaining space on the StatusBar. panel1.set_AutoSize(StatusBarPanelAutoSize.Spring); // Display the second panel with a raised border style. panel2.set_BorderStyle(StatusBarPanelBorderStyle.Raised); // Create ToolTip text that displays the time the application was started. panel2.set_ToolTipText("Started: " + System.DateTime.get_Now().ToShortTimeString()); // Set the text of the panel to the current date. panel2.set_Text(System.DateTime.get_Today().ToLongDateString()); // Set the AutoSize property to size the panel to the size of the // contents. panel2.set_AutoSize(StatusBarPanelAutoSize.Contents); // Display panels in the StatusBar control. statusBar1.set_ShowPanels(true); // Add both panels to the StatusBarPanelCollection of the StatusBar. statusBar1.get_Panels().Add(panel1); statusBar1.get_Panels().Add(panel2); // Add the StatusBar to the form. this.get_Controls().Add(statusBar1); } //CreateMyStatusBar

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


StatusBarPanel プロパティ

名前 | 説明 | |
---|---|---|
![]() | Alignment | ステータス バー パネル内のテキストおよびアイコンの配置を取得または設定します。 |
![]() | AutoSize | ステータス バー パネルが自動的にサイズ変更されるかどうかを示す値を取得または設定します。 |
![]() | BorderStyle | ステータス バー パネルの境界線スタイルを取得または設定します。 |
![]() | Container | Component を格納している IContainer を取得します。 ( Component から継承されます。) |
![]() | Icon | ステータス バー パネル内に表示するアイコンを取得または設定します。 |
![]() | MinWidth | StatusBar コントロール内のステータス バー パネルの最小有効幅を取得または設定します。 |
![]() | Name | StatusBarPanel に適用する名前を取得または設定します。 |
![]() | Parent | ステータス バー パネルをホストする StatusBar コントロールを取得します。 |
![]() | Site | Component の ISite を取得または設定します。 ( Component から継承されます。) |
![]() | Style | ステータス バー パネルのスタイルを取得または設定します。 |
![]() | Tag | StatusBarPanel に関するデータを格納するオブジェクトを取得または設定します。 |
![]() | Text | ステータス バー パネルのテキストを取得または設定します。 |
![]() | ToolTipText | ステータス バー パネルに関連付けられたツール ヒントのテキストを取得または設定します。 |
![]() | Width | StatusBar コントロール内のステータス バー パネルの幅を取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | CanRaiseEvents | コンポーネントがイベントを発生させることがきるかどうかを示す値を取得します。 ( Component から継承されます。) |
![]() | DesignMode | Component が現在デザイン モードかどうかを示す値を取得します。 ( Component から継承されます。) |
![]() | Events | Component に結び付けられているイベント ハンドラのリストを取得します。 ( Component から継承されます。) |

StatusBarPanel メソッド

名前 | 説明 | |
---|---|---|
![]() | BeginInit | StatusBarPanel の初期化を開始します。 |
![]() | CreateObjRef | リモート オブジェクトとの通信に使用するプロキシの生成に必要な情報をすべて格納しているオブジェクトを作成します。 ( MarshalByRefObject から継承されます。) |
![]() | Dispose | オーバーロードされます。 StatusBarPanel によって使用されているリソースを解放します。 |
![]() | EndInit | StatusBarPanel の初期化を終了します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetLifetimeService | 対象のインスタンスの有効期間ポリシーを制御する、現在の有効期間サービス オブジェクトを取得します。 ( MarshalByRefObject から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | InitializeLifetimeService | 対象のインスタンスの有効期間ポリシーを制御する、有効期間サービス オブジェクトを取得します。 ( MarshalByRefObject から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | オーバーライドされます。 パネルに関する情報を含む文字列を取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Dispose | オーバーロードされます。 オーバーライドされます。 StatusBarPanel によって使用されているリソースを解放します。 |
![]() | Finalize | Component がガベージ コレクションによってクリアされる前に、アンマネージ リソースを解放し、その他のクリーンアップ操作を実行します。 ( Component から継承されます。) |
![]() | GetService | Component またはその Container で提供されるサービスを表すオブジェクトを返します。 ( Component から継承されます。) |
![]() | MemberwiseClone | オーバーロードされます。 ( MarshalByRefObject から継承されます。) |

StatusBarPanel メンバ
StatusBar コントロール内のパネルを表します。StatusStrip コントロールでは、以前のバージョンの StatusBar コントロールの機能が置換および追加されていますが、下位互換性を維持し、今後必要に応じて使用できるように、StatusBar が保持されています。
StatusBarPanel データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Alignment | ステータス バー パネル内のテキストおよびアイコンの配置を取得または設定します。 |
![]() | AutoSize | ステータス バー パネルが自動的にサイズ変更されるかどうかを示す値を取得または設定します。 |
![]() | BorderStyle | ステータス バー パネルの境界線スタイルを取得または設定します。 |
![]() | Container | Component を格納している IContainer を取得します。(Component から継承されます。) |
![]() | Icon | ステータス バー パネル内に表示するアイコンを取得または設定します。 |
![]() | MinWidth | StatusBar コントロール内のステータス バー パネルの最小有効幅を取得または設定します。 |
![]() | Name | StatusBarPanel に適用する名前を取得または設定します。 |
![]() | Parent | ステータス バー パネルをホストする StatusBar コントロールを取得します。 |
![]() | Site | Component の ISite を取得または設定します。(Component から継承されます。) |
![]() | Style | ステータス バー パネルのスタイルを取得または設定します。 |
![]() | Tag | StatusBarPanel に関するデータを格納するオブジェクトを取得または設定します。 |
![]() | Text | ステータス バー パネルのテキストを取得または設定します。 |
![]() | ToolTipText | ステータス バー パネルに関連付けられたツール ヒントのテキストを取得または設定します。 |
![]() | Width | StatusBar コントロール内のステータス バー パネルの幅を取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | CanRaiseEvents | コンポーネントがイベントを発生させることがきるかどうかを示す値を取得します。(Component から継承されます。) |
![]() | DesignMode | Component が現在デザイン モードかどうかを示す値を取得します。(Component から継承されます。) |
![]() | Events | Component に結び付けられているイベント ハンドラのリストを取得します。(Component から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | BeginInit | StatusBarPanel の初期化を開始します。 |
![]() | CreateObjRef | リモート オブジェクトとの通信に使用するプロキシの生成に必要な情報をすべて格納しているオブジェクトを作成します。 (MarshalByRefObject から継承されます。) |
![]() | Dispose | オーバーロードされます。 StatusBarPanel によって使用されているリソースを解放します。 |
![]() | EndInit | StatusBarPanel の初期化を終了します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetLifetimeService | 対象のインスタンスの有効期間ポリシーを制御する、現在の有効期間サービス オブジェクトを取得します。 (MarshalByRefObject から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | InitializeLifetimeService | 対象のインスタンスの有効期間ポリシーを制御する、有効期間サービス オブジェクトを取得します。 (MarshalByRefObject から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | オーバーライドされます。 パネルに関する情報を含む文字列を取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Dispose | オーバーロードされます。 オーバーライドされます。 StatusBarPanel によって使用されているリソースを解放します。 |
![]() | Finalize | Component がガベージ コレクションによってクリアされる前に、アンマネージ リソースを解放し、その他のクリーンアップ操作を実行します。 (Component から継承されます。) |
![]() | GetService | Component またはその Container で提供されるサービスを表すオブジェクトを返します。 (Component から継承されます。) |
![]() | MemberwiseClone | オーバーロードされます。 ( MarshalByRefObject から継承されます。) |


- StatusBarPanelのページへのリンク