ToolBar.ToolBarButtonCollection 클래스

정의

ToolBarButton 클래스에서 사용할 ToolBar 컨트롤의 컬렉션을 캡슐화합니다.

public: ref class ToolBar::ToolBarButtonCollection : System::Collections::IList
public class ToolBar.ToolBarButtonCollection : System.Collections.IList
type ToolBar.ToolBarButtonCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class ToolBar.ToolBarButtonCollection
Implements IList
상속
ToolBar.ToolBarButtonCollection
구현

예제

다음 코드 예제에서는 a 및 3 ToolBarButton 개의 컨트롤을 ToolBar 만들고 초기화합니다. 도구 모음 단추가 도구 모음에 할당되고 도구 모음이 양식에 추가됩니다. 이 코드를 사용하려면 이미 만든 코드 Form 가 필요합니다.

public:
   void InitializeMyToolBar()
   {
      // Create and initialize the ToolBarButton controls and ToolBar.
      ToolBar^ toolBar1 = gcnew ToolBar;
      ToolBarButton^ toolBarButton1 = gcnew ToolBarButton;
      ToolBarButton^ toolBarButton2 = gcnew ToolBarButton;
      ToolBarButton^ toolBarButton3 = gcnew ToolBarButton;
      
      // Set the Text properties of the ToolBarButton controls.
      toolBarButton1->Text = "Open";
      toolBarButton2->Text = "Save";
      toolBarButton3->Text = "Print";
      
      // Add the ToolBarButton controls to the ToolBar.
      toolBar1->Buttons->Add( toolBarButton1 );
      toolBar1->Buttons->Add( toolBarButton2 );
      toolBar1->Buttons->Add( toolBarButton3 );
      
      // Add the ToolBar to the Form.
      Controls->Add( toolBar1 );
   }
public void InitializeMyToolBar()
 {
    // Create and initialize the ToolBarButton controls and ToolBar.
    ToolBar toolBar1 = new ToolBar();
    ToolBarButton toolBarButton1 = new ToolBarButton();
    ToolBarButton toolBarButton2 = new ToolBarButton();
    ToolBarButton toolBarButton3 = new ToolBarButton();
 
    // Set the Text properties of the ToolBarButton controls.
    toolBarButton1.Text = "Open";
    toolBarButton2.Text = "Save";
    toolBarButton3.Text = "Print";
 
    // Add the ToolBarButton controls to the ToolBar.
    toolBar1.Buttons.Add(toolBarButton1);
    toolBar1.Buttons.Add(toolBarButton2);
    toolBar1.Buttons.Add(toolBarButton3);
 
    // Add the ToolBar to the Form.
    Controls.Add(toolBar1);
 }
Public Sub InitializeMyToolBar()
    ' Create and initialize the ToolBarButton controls and ToolBar.
    Dim toolBar1 As New ToolBar()
    Dim toolBarButton1 As New ToolBarButton()
    Dim toolBarButton2 As New ToolBarButton()
    Dim toolBarButton3 As New ToolBarButton()
    
    ' Set the Text properties of the ToolBarButton controls.
    toolBarButton1.Text = "Open"
    toolBarButton2.Text = "Save"
    toolBarButton3.Text = "Print"
    
    ' Add the ToolBarButton controls to the ToolBar.
    toolBar1.Buttons.Add(toolBarButton1)
    toolBar1.Buttons.Add(toolBarButton2)
    toolBar1.Buttons.Add(toolBarButton3)
    
    ' Add the ToolBar to the Form.
    Controls.Add(toolBar1)
End Sub

설명

ToolBar.ToolBarButtonCollection 컬렉션은 도구 모음에 할당된 모든 컨트롤을 ToolBar 보유하기 위해 클래스에서 ToolBarButton 사용하는 인덱싱된 0부터 시작하는 컬렉션입니다. 메서드를 Add 사용하여 개별 단추를 Remove 추가하고 삭제하는 메서드를 사용합니다. 메서드를 Clear 호출하여 컬렉션에서 모든 단추를 제거합니다.

생성자

ToolBar.ToolBarButtonCollection(ToolBar)

ToolBar.ToolBarButtonCollection 클래스의 새 인스턴스를 초기화하고 지정된 도구 모음에 할당합니다.

속성

Count

도구 모음 단추 컬렉션의 단추 수를 가져옵니다.

IsReadOnly

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

Item[Int32]

도구 모음 단추 컬렉션에서 지정된 인덱스 위치에 있는 도구 모음 단추를 가져오거나 설정합니다.

Item[String]

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

메서드

Add(String)

지정한 Text 속성 값을 갖는 도구 모음 단추 컬렉션의 끝에 새 도구 모음 단추를 추가합니다.

Add(ToolBarButton)

도구 모음 단추 컬렉션의 끝에 지정된 도구 모음 단추를 추가합니다.

AddRange(ToolBarButton[])

이 도구 모음 단추 컬렉션에 도구 모음 단추의 컬렉션을 추가합니다.

Clear()

도구 모음 단추 컬렉션에서 모든 단추를 제거합니다.

Contains(ToolBarButton)

지정된 도구 모음 단추가 컬렉션의 멤버인지 확인합니다.

ContainsKey(String)

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

Equals(Object)

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

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

도구 모음 단추 컬렉션 전체에서 반복하는 데 사용할 수 있는 열거자를 반환합니다.

GetHashCode()

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

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

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

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

컬렉션에서 지정된 도구 모음 단추의 인덱스를 검색합니다.

IndexOfKey(String)

지정된 키를 가진 첫 번째 ToolBarButton의 인덱스를 검색합니다.

Insert(Int32, ToolBarButton)

도구 모음 단추 컬렉션의 지정된 위치에 기존의 도구 모음 단추를 삽입합니다.

MemberwiseClone()

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

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

도구 모음 단추 컬렉션에서 지정된 단추를 제거합니다.

RemoveAt(Int32)

도구 모음 단추 컬렉션에서 지정된 단추를 제거합니다.

RemoveByKey(String)

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

ToString()

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

(다음에서 상속됨 Object)

명시적 인터페이스 구현

ICollection.CopyTo(Array, Int32)

특정 ICollection 인덱스부터 시작하여 Array의 요소를 Array에 복사합니다.

ICollection.IsSynchronized

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

ICollection.SyncRoot

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

IList.Add(Object)

도구 모음 단추 컬렉션의 끝에 지정된 도구 모음 단추를 추가합니다.

IList.Contains(Object)

컬렉션에 특정 값이 있는지 여부를 확인합니다.

IList.IndexOf(Object)

컬렉션에 있는 특정 항목의 인덱스를 확인합니다.

IList.Insert(Int32, Object)

도구 모음 단추 컬렉션의 지정된 위치에 기존의 도구 모음 단추를 삽입합니다.

IList.IsFixedSize

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

IList.Item[Int32]

지정된 인덱스에서 항목을 가져오거나 설정합니다.

IList.Remove(Object)

컬렉션에서 맨 처음 발견되는 항목을 제거합니다.

확장 메서드

Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable)

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

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상

추가 정보