ToolBar.ToolBarButtonCollection.RemoveAt(Int32) 메서드

정의

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

public:
 virtual void RemoveAt(int index);
public void RemoveAt (int index);
abstract member RemoveAt : int -> unit
override this.RemoveAt : int -> unit
Public Sub RemoveAt (index As Integer)

매개 변수

index
Int32

컬렉션에 포함된 ToolBarButton의 인덱싱된 위치입니다.

구현

예외

index 값이 0보다 작거나 컬렉션의 단추 수보다 큰 경우

예제

다음 코드 예제에서는 마지막 ToolBarButton 을 제거 합니다 ToolBar. 제거되는 도구 모음 단추의 인덱스 값은 컬렉션이 0부터 시작하는 인덱스이므로 속성에서 1을 뺀 ToolBarButton 값으로 설정 Count 됩니다.

public:
   void RemoveMyButton()
   {
      int btns;
      btns = toolBar1->Buttons->Count;
      
      // Remove the last toolbar button.
      toolBar1->Buttons->RemoveAt( btns - 1 );
   }
public void RemoveMyButton()
 {
    int btns;
    btns = toolBar1.Buttons.Count;
 
    // Remove the last toolbar button.
    toolBar1.Buttons.RemoveAt(btns - 1);
 }
Public Sub RemoveMyButton()
    Dim btns As Integer
    btns = toolBar1.Buttons.Count
    
    ' Remove the last toolbar button.
    toolBar1.Buttons.RemoveAt(btns - 1)
End Sub

설명

메서드는 Remove .에서 지정된 위치에서 ToolBar.ToolBarButtonCollection제거합니다ToolBarButton. 컬렉션에서 모든 ToolBarButton 컨트롤을 제거 하려는 경우 메서드를 Clear 사용 합니다.

적용 대상

추가 정보