StatusBar.StatusBarPanelCollection 클래스

정의

StatusBar에 있는 패널의 컬렉션을 나타냅니다.

public: ref class StatusBar::StatusBarPanelCollection : System::Collections::IList
public class StatusBar.StatusBarPanelCollection : System.Collections.IList
[System.ComponentModel.ListBindable(false)]
public class StatusBar.StatusBarPanelCollection : System.Collections.IList
type StatusBar.StatusBarPanelCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
[<System.ComponentModel.ListBindable(false)>]
type StatusBar.StatusBarPanelCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class StatusBar.StatusBarPanelCollection
Implements IList
상속
StatusBar.StatusBarPanelCollection
특성
구현

예제

다음 코드 예제에서는 폼에 컨트롤을 StatusBar 만들고 두 개의 StatusBarPanel 개체를 추가합니다. 중 하나는 StatusBarPanel명명 된 panel1, 애플리케이션에 대 한 상태 텍스트를 표시 합니다. 이름이 지정된 두 번째 StatusBarPanel날짜는 현재 날짜를 표시하고 클래스의 StatusBarPanel 속성을 사용하여 ToolTipText 현재 시간을 표시panel2합니다. 이 예제에서는 이 속성을 사용하여 패널이 표준 패널 대신 표시되도록 하고, 패널을 추가할 메서드에 액세스 Add 하는 데 사용하는 속성과 Panels StatusBar이 속성을 사용합니다ShowPanels.StatusBar.StatusBarPanelCollection 또한 이 예제에서는 , 및 ToolTipText속성을 사용하여 AutoSize개체를 초기화합니다StatusBarPanel.Text BorderStyle 이 예제에서는 예제에 정의된 메서드가 정의되고 해당 생성자 Form에서 호출된다고 가정합니다.

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.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 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

설명

클래스는 StatusBar.StatusBarPanelCollection 에 표시된 패널을 StatusBar저장합니다. 컬렉션의 각 개체는 에 표시되는 패널의 StatusBarPanel 표시 특성 및 동작을 정의하는 클래스의 인스턴스입니다 StatusBar.

컬렉션에 패널을 추가하는 방법에는 여러 가지가 있습니다. 이 메서드는 Add 컬렉션에 단일 패널을 추가하는 기능을 제공합니다. 컬렉션에 여러 패널을 추가하려면 개체 배열 StatusBarPanel 을 만들고 메서드에 AddRange 할당합니다. 컬렉션 내의 특정 위치에 패널을 삽입하려는 경우 이 메서드를 Insert 사용할 수 있습니다. 패널을 제거하려면 컬렉션 내에서 패널이 Remove RemoveAt 있는 위치를 알고 있는 경우 메서드 또는 메서드를 사용할 수 있습니다. 이 Clear 메서드를 사용하면 메서드를 사용하여 Remove 한 번에 단일 패널을 제거하는 대신 컬렉션에서 모든 패널을 제거할 수 있습니다.

패널을 추가 및 제거하기 위한 메서드 및 속성 외에도 컬렉션 내에서 패널 StatusBar.StatusBarPanelCollection 을 찾는 메서드도 제공합니다. 이 Contains 메서드를 사용하면 패널이 컬렉션의 멤버인지 여부를 확인할 수 있습니다. 패널이 컬렉션 내에 있다는 것을 알게 되면 이 메서드를 IndexOf 사용하여 컬렉션 내에서 패널이 있는 위치를 확인할 수 있습니다.

생성자

StatusBar.StatusBarPanelCollection(StatusBar)

StatusBar.StatusBarPanelCollection 클래스의 새 인스턴스를 초기화합니다.

속성

Count

컬렉션의 항목 수를 가져옵니다.

IsReadOnly

이 컬렉션이 읽기 전용인지 여부를 나타내는 값을 가져옵니다.

Item[Int32]

지정된 인덱스에 있는 StatusBarPanel를 가져오거나 설정합니다.

Item[String]

컬렉션에서 지정된 키를 가진 항목을 가져옵니다.

메서드

Add(StatusBarPanel)

StatusBarPanel를 컬렉션에 추가합니다.

Add(String)

지정된 텍스트를 가지는 StatusBarPanel을 컬렉션에 추가합니다.

AddRange(StatusBarPanel[])

컬렉션에 StatusBarPanel 개체 배열을 추가합니다.

Clear()

컬렉션에서 모든 항목을 제거합니다.

Contains(StatusBarPanel)

지정된 패널이 컬렉션에 위치하는지 여부를 확인합니다.

ContainsKey(String)

컬렉션에 지정된 키를 가진 StatusBarPanel이 있는지 여부를 확인합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetEnumerator()

항목 컬렉션을 반복하는 데 사용할 열거자를 반환합니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
IndexOf(StatusBarPanel)

지정된 패널에 대한 컬렉션의 인덱스를 반환합니다.

IndexOfKey(String)

지정된 키를 가진 첫 번째 StatusBarPanel의 인덱스를 반환합니다.

Insert(Int32, StatusBarPanel)

지정된 StatusBarPanel를 컬렉션의 지정된 인덱스에 삽입합니다.

MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
Remove(StatusBarPanel)

지정된 StatusBarPanel를 컬렉션에서 제거합니다.

RemoveAt(Int32)

컬렉션에서 지정된 인덱스의 StatusBarPanel을 제거합니다.

RemoveByKey(String)

지정한 키를 가진 StatusBarPanel을 컬렉션에서 제거합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

ICollection.CopyTo(Array, Int32)

대상 배열의 지정된 인덱스에서 시작하여 StatusBar.StatusBarPanelCollection을 호환되는 1차원 배열에 복사합니다.

ICollection.IsSynchronized

해당 컬렉션에 대한 액세스가 동기화되어 스레드로부터 안전하게 보호되는지를 나타내는 값을 가져옵니다.

ICollection.SyncRoot

컬렉션에 대한 액세스를 동기화하는 데 사용할 수 있는 개체를 가져옵니다.

IList.Add(Object)

이 API는 제품 인프라를 지원하며 코드에서 직접 사용되지 않습니다.

StatusBarPanel를 컬렉션에 추가합니다.

IList.Contains(Object)

지정된 패널이 컬렉션에 위치하는지 여부를 확인합니다.

IList.IndexOf(Object)

컬렉션 안에 있는 지정된 패널의 인덱스를 반환합니다.

IList.Insert(Int32, Object)

지정된 StatusBarPanel를 컬렉션의 지정된 인덱스에 삽입합니다.

IList.IsFixedSize

컬렉션의 크기가 고정되어 있는지를 나타내는 값을 가져옵니다.

IList.Item[Int32]

지정한 인덱스에 있는 요소를 가져오거나 설정합니다.

IList.Remove(Object)

지정된 StatusBarPanel를 컬렉션에서 제거합니다.

확장 메서드

Cast<TResult>(IEnumerable)

IEnumerable의 요소를 지정된 형식으로 캐스팅합니다.

OfType<TResult>(IEnumerable)

지정된 형식에 따라 IEnumerable의 요소를 필터링합니다.

AsParallel(IEnumerable)

쿼리를 병렬화할 수 있도록 합니다.

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상

추가 정보