StatusBar.StatusBarPanelCollection クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


StatusBar.StatusBarPanelCollection クラスは、StatusBar に表示されるパネルを格納します。このコレクション内の各オブジェクトは、StatusBar 内に表示されるパネルの表示特性と表示動作を定義する、StatusBarPanel クラスのインスタンスです。
パネルをコレクションに追加するには、いくつか方法があります。Add メソッドを使用すると、単一のパネルをコレクションに追加できます。複数のパネルをコレクションに追加するには、StatusBarPanel オブジェクトの配列を作成し、その配列を AddRange メソッドに割り当てます。コレクション内の特定の位置にパネルを挿入するには、Insert メソッドを使用します。パネルを削除するには、Remove メソッドか、コレクション内のパネルの位置が判明している場合は RemoveAt メソッドを使用できます。一度に 1 つのパネルしか削除できない Remove メソッドを使用する代わりに、Clear メソッドを使用すると、コレクションからすべてのパネルを削除できます。
パネルを追加および削除するメソッドやプロパティのほかに、StatusBar.StatusBarPanelCollection は、コレクション内でパネルを検索するメソッドも提供します。Contains メソッドを使用すると、パネルがコレクションのメンバであるかどうかを確認できます。コレクション内にパネルがあることがわかれば、IndexOf メソッドを使用して、そのパネルがコレクションのどこにあるかを判断できます。

フォームに StatusBar コントロールを作成し、2 つの StatusBarPanel オブジェクトを追加するコード例を次に示します。StatusBarPanel の 1 つである panel1 は、アプリケーションのステータス テキストを表示します。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.Windows.Forms.StatusBar.StatusBarPanelCollection


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


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



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


StatusBar.StatusBarPanelCollection クラス
StatusBar.StatusBarPanelCollection メンバ
System.Windows.Forms 名前空間
StatusBar.StatusBarPanelCollection プロパティ

名前 | 説明 | |
---|---|---|
![]() | Count | コレクション内の項目の数を取得します。 |
![]() | IsReadOnly | コレクションが読み取り専用かどうかを示す値を取得します。 |
![]() | Item | オーバーロードされます。 コレクション内の項目を取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | System.Collections.ICollection.IsSynchronized | コレクションへのアクセスが同期されている (スレッド セーフである) かどうかを示す値を取得します。 |
![]() | System.Collections.ICollection.SyncRoot | コレクションへのアクセスを同期するために使用できるオブジェクトを取得します。 |
![]() | System.Collections.IList.IsFixedSize | コレクションが固定サイズかどうかを示す値を取得します。 |
![]() | System.Collections.IList.Item | 指定したインデックスにある要素を取得または設定します。 |

StatusBar.StatusBarPanelCollection メソッド

名前 | 説明 | |
---|---|---|
![]() | Add | オーバーロードされます。 StatusBarPanel をコレクションに追加します。 |
![]() | AddRange | コレクションに StatusBarPanel オブジェクトの配列を追加します。 |
![]() | Clear | コレクションからすべての項目を削除します。 |
![]() | Contains | 指定したパネルがコレクション内にあるかどうかを確認します。 |
![]() | ContainsKey | 指定したキーの StatusBarPanel がコレクションに含まれているかどうかを確認します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetEnumerator | 項目コレクションを反復処理するために使用する列挙子を返します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | IndexOf | 指定したパネルのコレクション内のインデックスを返します。 |
![]() | IndexOfKey | 指定したキーを持つ StatusBarPanel が最初に見つかった位置のインデックスを返します。 |
![]() | Insert | コレクション内の指定したインデックス位置に、指定した StatusBarPanel を挿入します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | Remove | 指定した StatusBarPanel をコレクションから削除します。 |
![]() | RemoveAt | コレクション内の指定したインデックスにある StatusBarPanel を削除します。 |
![]() | RemoveByKey | 指定したキーを持つ StatusBarPanel をコレクションから削除します。 |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.Collections.ICollection.CopyTo | StatusBar.StatusBarPanelCollection を互換性のある 1 次元配列にコピーします。コピー操作は、コピー先の配列の指定したインデックスから始まります。 |
![]() | System.Collections.IList.Add | StatusBarPanel をコレクションに追加します。 |
![]() | System.Collections.IList.Contains | 指定したパネルがコレクション内にあるかどうかを確認します。 |
![]() | System.Collections.IList.IndexOf | コレクション内の指定したパネルのインデックスを返します。 |
![]() | System.Collections.IList.Insert | コレクション内の指定したインデックス位置に、指定した StatusBarPanel を挿入します。 |
![]() | System.Collections.IList.Remove | 指定した StatusBarPanel をコレクションから削除します。 |

StatusBar.StatusBarPanelCollection メンバ
StatusBar コントロール内のパネルのコレクションを表します。
StatusBar.StatusBarPanelCollection データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Count | コレクション内の項目の数を取得します。 |
![]() | IsReadOnly | コレクションが読み取り専用かどうかを示す値を取得します。 |
![]() | Item | オーバーロードされます。 コレクション内の項目を取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | Add | オーバーロードされます。 StatusBarPanel をコレクションに追加します。 |
![]() | AddRange | コレクションに StatusBarPanel オブジェクトの配列を追加します。 |
![]() | Clear | コレクションからすべての項目を削除します。 |
![]() | Contains | 指定したパネルがコレクション内にあるかどうかを確認します。 |
![]() | ContainsKey | 指定したキーの StatusBarPanel がコレクションに含まれているかどうかを確認します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetEnumerator | 項目コレクションを反復処理するために使用する列挙子を返します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | IndexOf | 指定したパネルのコレクション内のインデックスを返します。 |
![]() | IndexOfKey | 指定したキーを持つ StatusBarPanel が最初に見つかった位置のインデックスを返します。 |
![]() | Insert | コレクション内の指定したインデックス位置に、指定した StatusBarPanel を挿入します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | Remove | 指定した StatusBarPanel をコレクションから削除します。 |
![]() | RemoveAt | コレクション内の指定したインデックスにある StatusBarPanel を削除します。 |
![]() | RemoveByKey | 指定したキーを持つ StatusBarPanel をコレクションから削除します。 |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.Collections.ICollection.CopyTo | StatusBar.StatusBarPanelCollection を互換性のある 1 次元配列にコピーします。コピー操作は、コピー先の配列の指定したインデックスから始まります。 |
![]() | System.Collections.IList.Add | StatusBarPanel をコレクションに追加します。 |
![]() | System.Collections.IList.Contains | 指定したパネルがコレクション内にあるかどうかを確認します。 |
![]() | System.Collections.IList.IndexOf | コレクション内の指定したパネルのインデックスを返します。 |
![]() | System.Collections.IList.Insert | コレクション内の指定したインデックス位置に、指定した StatusBarPanel を挿入します。 |
![]() | System.Collections.IList.Remove | 指定した StatusBarPanel をコレクションから削除します。 |
![]() | System.Collections.ICollection.IsSynchronized | コレクションへのアクセスが同期されている (スレッド セーフである) かどうかを示す値を取得します。 |
![]() | System.Collections.ICollection.SyncRoot | コレクションへのアクセスを同期するために使用できるオブジェクトを取得します。 |
![]() | System.Collections.IList.IsFixedSize | コレクションが固定サイズかどうかを示す値を取得します。 |
![]() | System.Collections.IList.Item | 指定したインデックスにある要素を取得または設定します。 |

Weblioに収録されているすべての辞書からStatusBar.StatusBarPanelCollectionを検索する場合は、下記のリンクをクリックしてください。

- StatusBar.StatusBarPanelCollectionのページへのリンク