StatusBarPanel 클래스

정의

StatusBar 컨트롤에 있는 패널을 나타냅니다.

이 클래스는 .NET 5 이상 버전에서는 사용할 수 없습니다. 대신 컨트롤을 ToolStripStatusLabel 사용하여 컨트롤을 바꾸고 확장합니다 StatusBarPanel .

public ref class StatusBarPanel : System::ComponentModel::Component, System::ComponentModel::ISupportInitialize
public class StatusBarPanel : System.ComponentModel.Component, System.ComponentModel.ISupportInitialize
type StatusBarPanel = class
    inherit Component
    interface ISupportInitialize
Public Class StatusBarPanel
Inherits Component
Implements ISupportInitialize
상속
구현

예제

다음 코드 예제에서는 폼에 컨트롤을 StatusBar 만들고 두 개의 StatusBarPanel 개체를 추가합니다. 첫 번째 StatusBarPanel명명 된 panel1, 애플리케이션에 대 한 상태 텍스트를 표시 합니다. 라는 두 번째 StatusBarPanel는 현재 날짜를 표시하고 클래스의 StatusBarPanel 속성을 사용하여 ToolTipText 현재 시간을 표시panel2합니다. 이 예제에서는 속성을 사용하여 ShowPanels 패널이 표준 패널 대신 표시되도록 하고 속성을 사용하여 PanelsStatusBar.StatusBarPanelCollection 메서드에 액세스 Add 하여 패널을 에 추가합니다StatusBar. 이 예제에서는 , , 및 속성을 사용하여 AutoSize개체를 초기화합니다StatusBarPanel.TextToolTipTextBorderStyle 이 예제에서는 예제에 정의된 메서드가 의 생성자 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

설명

이 클래스는 .NET 5 이상 버전에서는 사용할 수 없습니다. 대신 컨트롤을 ToolStripStatusLabel 사용합니다.

StatusBarPanel 컨트롤의 에 있는 StatusBar.StatusBarPanelCollection 개별 패널을 StatusBar 나타냅니다. StatusBarPanel 텍스트 및/또는 애플리케이션의 상태를 반영 하도록 사용할 수 있는 아이콘을 포함할 수 있습니다. StatusBar.StatusBarPanelCollection컨트롤의 속성을 통해 StatusBar.Panels 액세스할 수 있는 를 StatusBar 사용하여 개별 StatusBarPanel를 검색, 추가 또는 제거합니다.

StatusBarPanel 컨트롤 내에서 StatusBar 패널의 표시 동작을 수정할 수 있는 속성을 제공합니다. 사용할 수 있습니다는 Icon 패널 내에서 아이콘을 표시 하는 속성입니다. 이 속성은 상태 애플리케이션에 대 한 그래픽 표현을 제공 하려면 사용할 수 있습니다. Alignment 속성을 사용하면 패널 내에서 텍스트 및/또는 아이콘이 정렬되는 방식을 지정할 수 있습니다. 패널의 텍스트에 맞게 패널의 크기를 올바르게 하려면 사용 하 여 AutoSize 는 패널의 텍스트에 맞게 패널 크기를 자동으로 조정 하거나 컨트롤 내에서 StatusBar 나머지 공간을 채우기 위해 속성입니다. 속성을 MinWidth 사용하면 패널의 최소 너비를 지정하여 패널이 표시하려는 데이터보다 작아지지 않도록 할 수 있습니다.

StatusBar 컨트롤은 일반적으로 도움말 정보 또는 애플리케이션에 대 한 상태 정보를 표시 하는 데 사용 됩니다. 패널에 표시되는 데이터에 대한 추가 정보를 표시하는 것이 중요한 경우가 많습니다. 마우스 포인터가 패널에 ToolTipText 놓일 때마다 속성을 사용하여 정보를 표시할 수 있습니다.

컨트롤은 StatusBar 일반적으로 텍스트 정보를 표시하는 데 사용되지만 에 고유한 유형의 표시를 StatusBarPanel제공할 수도 있습니다. 속성을 Style 사용하면 를 그릴 방법을 StatusBarPanel 지정할 수 있습니다. 기본적으로 속성의 Style 값을 Text 표시 하는 데 사용 됩니다 (및 아이콘, 속성에 Icon 지정 된 경우). 속성이 로 설정된 OwnerDraw경우 패널에 사용자 고유의 정보를 그릴 수 있습니다. 이 기능을 사용하여 패널에서 진행률 표시줄 또는 애니메이션 아이콘을 그릴 수 있습니다.

클래스의 StatusBarPanel instance 만들면 읽기/쓰기 속성이 초기 값으로 설정됩니다. 이러한 값의 목록을 보려면 참조는 StatusBarPanel 생성자입니다.

생성자

StatusBarPanel()

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

속성

Alignment

상태 표시줄 패널 내의 텍스트 및 아이콘 맞춤을 가져오거나 설정합니다.

AutoSize

상태 표시줄 패널의 크기를 자동으로 조정할지를 나타내는 값을 가져오거나 설정합니다.

BorderStyle

상태 표시줄 패널의 테두리 스타일을 가져오거나 설정합니다.

CanRaiseEvents

구성 요소가 이벤트를 발생시킬 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
Container

IContainer을 포함하는 Component를 가져옵니다.

(다음에서 상속됨 Component)
DesignMode

Component가 현재 디자인 모드인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
Events

Component에 연결된 이벤트 처리기의 목록을 가져옵니다.

(다음에서 상속됨 Component)
Icon

상태 표시줄 패널에 표시할 아이콘을 가져오거나 설정합니다.

MinWidth

StatusBar 컨트롤 내에서 허용되는 상태 표시줄 패널의 최소 너비를 가져오거나 설정합니다.

Name

StatusBarPanel에 적용할 이름을 가져오거나 설정합니다.

Parent

상태 표시줄 패널을 호스팅하는 StatusBar 컨트롤을 가져옵니다.

Site

ComponentISite를 가져오거나 설정합니다.

(다음에서 상속됨 Component)
Style

상태 표시줄 패널의 스타일을 가져오거나 설정합니다.

Tag

StatusBarPanel에 대한 데이터가 들어 있는 개체를 가져오거나 설정합니다.

Text

상태 표시줄 패널의 텍스트를 가져오거나 설정합니다.

ToolTipText

상태 표시줄 패널과 관련된 도구 설명 텍스트를 가져오거나 설정합니다.

Width

StatusBar 컨트롤 내에 있는 상태 표시줄 패널의 너비를 가져오거나 설정합니다.

메서드

BeginInit()

StatusBarPanel 초기화를 시작합니다.

CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시 생성에 필요한 모든 관련 정보가 들어 있는 개체를 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
Dispose()

Component에서 사용하는 모든 리소스를 해제합니다.

(다음에서 상속됨 Component)
Dispose(Boolean)

StatusBarPanel에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.

EndInit()

StatusBarPanel 초기화를 끝냅니다.

Equals(Object)

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

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

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

(다음에서 상속됨 Object)
GetLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 현재의 수명 서비스 개체를 검색합니다.

(다음에서 상속됨 MarshalByRefObject)
GetService(Type)

Component 또는 해당 Container에서 제공하는 서비스를 나타내는 개체를 반환합니다.

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

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

(다음에서 상속됨 Object)
InitializeLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.

(다음에서 상속됨 MarshalByRefObject)
MemberwiseClone()

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

(다음에서 상속됨 Object)
MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
ToString()

패널에 대한 정보가 포함된 문자열을 검색합니다.

이벤트

Disposed

Dispose() 메서드를 호출하여 구성 요소를 삭제할 때 발생합니다.

(다음에서 상속됨 Component)

적용 대상

추가 정보