Control.ControlCollection 클래스

정의

Control 개체의 컬렉션을 나타냅니다.

public: ref class Control::ControlCollection : ICloneable, System::Collections::IList
public: ref class Control::ControlCollection : System::Windows::Forms::Layout::ArrangedElementCollection, ICloneable, System::Collections::IList
[System.ComponentModel.ListBindable(false)]
public class Control.ControlCollection : ICloneable, System.Collections.IList
[System.ComponentModel.ListBindable(false)]
[System.Runtime.InteropServices.ComVisible(false)]
public class Control.ControlCollection : System.Windows.Forms.Layout.ArrangedElementCollection, ICloneable, System.Collections.IList
[System.ComponentModel.ListBindable(false)]
public class Control.ControlCollection : System.Windows.Forms.Layout.ArrangedElementCollection, ICloneable, System.Collections.IList
[<System.ComponentModel.ListBindable(false)>]
type Control.ControlCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
    interface ICloneable
[<System.ComponentModel.ListBindable(false)>]
[<System.Runtime.InteropServices.ComVisible(false)>]
type Control.ControlCollection = class
    inherit ArrangedElementCollection
    interface IList
    interface ICollection
    interface IEnumerable
    interface ICloneable
[<System.ComponentModel.ListBindable(false)>]
type Control.ControlCollection = class
    inherit ArrangedElementCollection
    interface IList
    interface ICollection
    interface IEnumerable
    interface ICloneable
Public Class Control.ControlCollection
Implements ICloneable, IList
Public Class Control.ControlCollection
Inherits ArrangedElementCollection
Implements ICloneable, IList
상속
Control.ControlCollection
상속
Control.ControlCollection
파생
특성
구현

예제

다음 코드 예제에서는 컬렉션의 멤버인 경우 파생 클래스 Panel 에서 Control.ControlCollection 제거 Control 합니다. 이 예제에서는 에 대해 하나 이상의 컨트롤, a Button및 하나 이상의 RadioButton 컨트롤을 Form만들어야 Panel합니다. 컨트롤이 RadioButton 컨트롤에 Panel 추가되고 컨트롤이 Panel 추가됩니다 Form. 단추를 클릭하면 이름이 지정된 radioButton2 라디오 단추가 제거 Control.ControlCollection됩니다.

   // Remove the RadioButton control if it exists.
private:
   void removeButton_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      if ( panel1->Controls->Contains( removeButton ) )
      {
         panel1->Controls->Remove( removeButton );
      }
   }
// Remove the RadioButton control if it exists.
private void removeButton_Click(object sender, System.EventArgs e)
{
   if(panel1.Controls.Contains(removeButton))
   {
      panel1.Controls.Remove(removeButton);
   }
}
' Remove the RadioButton control if it exists.
Private Sub RemoveButton_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles RemoveButton.Click
    If Panel1.Controls.Contains(RemoveButton) Then
        Panel1.Controls.Remove(RemoveButton)
    End If
End Sub

설명

합니다 Add, Remove, 및 RemoveAt 메서드를 사용 하면 추가 하 고 컬렉션에서 개별 컨트롤을 제거 합니다. 사용할 수도 있습니다는 AddRange 또는 Clear 메서드를 추가 하거나 컬렉션에서 모든 컨트롤을 제거 합니다.

메서드에 컨트롤 Contains 을 전달하여 컬렉션 Control 의 멤버인지 확인할 수 있습니다. 위치의 인덱스 값을 가져올는 Control 컬렉션에 컨트롤을 전달 합니다 IndexOf 메서드. 호출 하 여 컬렉션을 배열에 복사 될 수는 CopyTo 메서드.

생성자

Control.ControlCollection(Control)

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

속성

Count

컬렉션에 포함된 요소 수를 가져옵니다.

Count

컬렉션의 요소 수를 가져옵니다.

(다음에서 상속됨 ArrangedElementCollection)
IsReadOnly

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

IsReadOnly

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

(다음에서 상속됨 ArrangedElementCollection)
Item[Int32]

컬렉션에서 지정된 인덱스 위치의 Control를 나타냅니다.

Item[String]

컬렉션에서 지정된 키를 갖는 Control을 나타냅니다.

Owner

Control.ControlCollection을 소유하는 컨트롤을 가져옵니다.

메서드

Add(Control)

지정된 컨트롤을 컨트롤 컬렉션에 추가합니다.

AddRange(Control[])

컨트롤 개체의 배열을 컬렉션에 추가합니다.

Clear()

컬렉션에서 컨트롤을 모두 제거합니다.

Contains(Control)

지정된 컨트롤이 컬렉션의 멤버인지 여부를 확인합니다.

ContainsKey(String)

Control.ControlCollection에 지정된 키를 갖는 항목이 포함되어 있는지 여부를 확인합니다.

CopyTo(Array, Int32)

특정 배열 인덱스부터 시작하여 컬렉션의 요소를 배열에 복사합니다.

CopyTo(Array, Int32)

대상 배열의 지정된 인덱스에서 시작하여 이 컬렉션의 전체 콘텐츠를 호환되는 1차원 Array에 복사합니다.

(다음에서 상속됨 ArrangedElementCollection)
Equals(Object)

현재 컬렉션 개체와 지정된 개체가 같은지 여부를 지정합니다.

Equals(Object)

두 개의 ArrangedElementCollection 인스턴스가 같은지 여부를 확인합니다.

(다음에서 상속됨 ArrangedElementCollection)
Find(String, Boolean)

Name 속성으로 컨트롤을 검색하고 일치하는 모든 컨트롤의 배열을 만듭니다.

GetChildIndex(Control)

컨트롤 컬렉션 내에 있는 지정된 자식 컨트롤의 인덱스를 가져옵니다.

GetChildIndex(Control, Boolean)

컨트롤 컬렉션 내에 있는 지정된 자식 컨트롤의 인덱스를 가져옵니다. 지정된 컨트롤이 컨트롤 컬렉션 내에 없으면 예외가 발생할 수도 있습니다.

GetEnumerator()

Control.ControlCollection을 반복하는 데 사용되는 열거자 개체에 대한 참조를 검색합니다.

GetHashCode()

이 인스턴스의 해시 코드를 반환합니다.

GetHashCode()

이 인스턴스의 해시 코드를 반환합니다.

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

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

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

컨트롤 컬렉션 내에 있는 지정된 컨트롤의 인덱스를 나타냅니다.

IndexOfKey(String)

컬렉션에서 지정된 항목이 처음 발견된 위치의 인덱스를 검색합니다.

MemberwiseClone()

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

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

컨트롤 컬렉션에서 지정된 컨트롤을 제거합니다.

RemoveAt(Int32)

컨트롤 컬렉션에서 지정된 인덱스 위치의 컨트롤을 제거합니다.

RemoveByKey(String)

지정된 키를 갖는 자식 컨트롤을 제거합니다.

SetChildIndex(Control, Int32)

컬렉션에 있는 지정된 자식 컨트롤의 인덱스를 지정된 인덱스 값으로 설정합니다.

ToString()

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

(다음에서 상속됨 Object)

명시적 인터페이스 구현

ICloneable.Clone()

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

이 멤버에 대한 설명은 Clone()를 참조하세요.

ICollection.IsSynchronized

이 멤버에 대한 설명을 보려면 IsSynchronized 속성을 참조하세요.

(다음에서 상속됨 ArrangedElementCollection)
ICollection.SyncRoot

이 멤버에 대한 설명을 보려면 SyncRoot 속성을 참조하세요.

(다음에서 상속됨 ArrangedElementCollection)
IList.Add(Object)

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

이 멤버에 대한 설명은 Add(Object)를 참조하세요.

IList.Clear()

이 멤버에 대한 설명을 보려면 Clear() 메서드를 참조하세요.

(다음에서 상속됨 ArrangedElementCollection)
IList.Contains(Object)

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

이 멤버에 대한 설명은 Contains(Object)를 참조하세요.

IList.Contains(Object)

이 멤버에 대한 설명을 보려면 Contains(Object) 메서드를 참조하세요.

(다음에서 상속됨 ArrangedElementCollection)
IList.IndexOf(Object)

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

이 멤버에 대한 설명은 IndexOf(Object)를 참조하세요.

IList.IndexOf(Object)

이 멤버에 대한 설명을 보려면 IndexOf(Object) 메서드를 참조하세요.

(다음에서 상속됨 ArrangedElementCollection)
IList.Insert(Int32, Object)

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

이 멤버에 대한 설명은 Insert(Int32, Object)를 참조하세요.

IList.Insert(Int32, Object)

이 멤버에 대한 설명을 보려면 Insert(Int32, Object) 메서드를 참조하세요.

(다음에서 상속됨 ArrangedElementCollection)
IList.IsFixedSize

이 멤버에 대한 설명을 보려면 IsFixedSize 속성을 참조하세요.

(다음에서 상속됨 ArrangedElementCollection)
IList.Item[Int32]

이 멤버에 대한 설명을 보려면 Item[Int32] 속성을 참조하세요.

(다음에서 상속됨 ArrangedElementCollection)
IList.Remove(Object)

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

이 멤버에 대한 설명은 Remove(Object)를 참조하세요.

IList.RemoveAt(Int32)

이 멤버에 대한 설명을 보려면 RemoveAt(Int32) 메서드를 참조하세요.

(다음에서 상속됨 ArrangedElementCollection)

확장 메서드

Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable)

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

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상

추가 정보