CheckedListBox.ObjectCollection 클래스

정의

CheckedListBox에 포함된 항목의 컬렉션을 나타냅니다.

public: ref class CheckedListBox::ObjectCollection : System::Windows::Forms::ListBox::ObjectCollection
public class CheckedListBox.ObjectCollection : System.Windows.Forms.ListBox.ObjectCollection
type CheckedListBox.ObjectCollection = class
    inherit ListBox.ObjectCollection
Public Class CheckedListBox.ObjectCollection
Inherits ListBox.ObjectCollection
상속
CheckedListBox.ObjectCollection

예제

항목을 열거 하는 다음 예제는 CheckedListBox 목록의 다른 모든 항목을 확인 합니다. 예제를 사용 하 여는 Items 가져올 속성을 CheckedListBox.ObjectCollection 가져오려고를 Count 항목의 합니다.

또한 예제에 사용 하는 SetItemCheckStateSetItemChecked 항목의 선택 상태를 설정 하는 방법입니다. 선택 해야 하는 다른 모든 항목에 대 한 SetItemCheckState 설정 하기 위해 호출 됩니다 합니다 CheckStateIndeterminate, 하는 동안 SetItemChecked 선택된 상태 설정 하려면 다른 항목에서 호출 됩니다 Checked.

void CheckEveryOther_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   
   // Cycle through every item and check every other.
   // Set flag to true to know when this code is being executed. Used in the ItemCheck
   // event handler.
   insideCheckEveryOther = true;
   for ( int i = 0; i < checkedListBox1->Items->Count; i++ )
   {
      
      // For every other item in the list, set as checked.
      if ( (i % 2) == 0 )
      {
         
         // But for each other item that is to be checked, set as being in an
         // indeterminate checked state.
         if ( (i % 4) == 0 )
                     checkedListBox1->SetItemCheckState( i, CheckState::Indeterminate );
         else
                     checkedListBox1->SetItemChecked( i, true );
      }

   }
   insideCheckEveryOther = false;
}
private void CheckEveryOther_Click(object sender, System.EventArgs e) {
    // Cycle through every item and check every other.

    // Set flag to true to know when this code is being executed. Used in the ItemCheck
    // event handler.
    insideCheckEveryOther = true;

    for (int i = 0; i < checkedListBox1.Items.Count; i++) {
        // For every other item in the list, set as checked.
        if ((i % 2) == 0) {
            // But for each other item that is to be checked, set as being in an
            // indeterminate checked state.
            if ((i % 4) == 0)
                checkedListBox1.SetItemCheckState(i, CheckState.Indeterminate);
            else
                checkedListBox1.SetItemChecked(i, true);
        }
    }

    insideCheckEveryOther = false;
}
Private Sub CheckEveryOther_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckEveryOther.Click
    ' Cycle through every item and check every other.
    Dim i As Integer

    ' Set flag to true to know when this code is being executed. Used in the ItemCheck
    ' event handler.
    insideCheckEveryOther = True

    For i = 0 To CheckedListBox1.Items.Count - 1
        ' For every other item in the list, set as checked.

        If ((i Mod 2) = 0) Then
            ' But for each other item that is to be checked, set as being in an
            ' indeterminate checked state.

            If ((i Mod 4) = 0) Then
                CheckedListBox1.SetItemCheckState(i, CheckState.Indeterminate)
            Else
                CheckedListBox1.SetItemChecked(i, True)
            End If
        End If
    Next

    insideCheckEveryOther = False

End Sub

설명

부모 컨트롤에서 해당 컬렉션에 액세스 CheckedListBoxItems 속성입니다. 표시할 개체의 컬렉션을 만드는 CheckedListBox 컨트롤을 추가 하거나 사용 하 여 개별적으로 항목을 제거할 수 있습니다 합니다 AddRemove 메서드.

생성자

CheckedListBox.ObjectCollection(CheckedListBox)

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

속성

Count

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

(다음에서 상속됨 ListBox.ObjectCollection)
IsReadOnly

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

(다음에서 상속됨 ListBox.ObjectCollection)
Item[Int32]

컬렉션 내의 지정된 인덱스에 있는 항목을 가져오거나 설정합니다.

(다음에서 상속됨 ListBox.ObjectCollection)

메서드

Add(Object)

ListBox의 항목 목록에 항목을 추가합니다.

(다음에서 상속됨 ListBox.ObjectCollection)
Add(Object, Boolean)

항목을 CheckedListBox의 항목 목록에 추가하고, 추가할 개체와 개체의 선택 여부를 지정합니다.

Add(Object, CheckState)

항목을 CheckedListBox 항목 목록에 추가하고, 추가할 개체와 초기 선택 값을 지정합니다.

AddRange(ListBox+ObjectCollection)

ListBox.ObjectCollection의 항목 목록에 기존 ListBox 항목을 추가합니다.

(다음에서 상속됨 ListBox.ObjectCollection)
AddRange(Object[])

ListBox의 항목 목록에 항목 배열을 추가합니다.

(다음에서 상속됨 ListBox.ObjectCollection)
Clear()

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

(다음에서 상속됨 ListBox.ObjectCollection)
Contains(Object)

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

(다음에서 상속됨 ListBox.ObjectCollection)
CopyTo(Object[], Int32)

배열 내의 지정된 위치에 있는 개체의 기존 배열로 전체 컬렉션을 복사합니다.

(다음에서 상속됨 ListBox.ObjectCollection)
Equals(Object)

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

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

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

(다음에서 상속됨 ListBox.ObjectCollection)
GetHashCode()

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

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

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

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

지정된 항목의 컬렉션 내에 있는 인덱스를 반환합니다.

(다음에서 상속됨 ListBox.ObjectCollection)
Insert(Int32, Object)

목록 상자 내의 지정된 인덱스에 항목을 삽입합니다.

(다음에서 상속됨 ListBox.ObjectCollection)
MemberwiseClone()

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

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

컬렉션에서 지정한 개체를 제거합니다.

(다음에서 상속됨 ListBox.ObjectCollection)
RemoveAt(Int32)

컬렉션 내의 지정된 인덱스에 있는 항목을 제거합니다.

(다음에서 상속됨 ListBox.ObjectCollection)
ToString()

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

(다음에서 상속됨 Object)

명시적 인터페이스 구현

ICollection.CopyTo(Array, Int32)

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

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

(다음에서 상속됨 ListBox.ObjectCollection)
ICollection.IsSynchronized

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

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

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

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

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

ListBox 클래스에 개체를 추가합니다.

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

IList에 특정 값이 들어 있는지 여부를 확인합니다.

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

IList에서 특정 항목의 인덱스를 결정합니다.

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

항목을 IList의 지정된 인덱스에 삽입합니다.

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

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

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

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

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

IList에서 맨 처음 발견되는 특정 개체를 제거합니다.

(다음에서 상속됨 ListBox.ObjectCollection)

확장 메서드

Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable)

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

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상