DomainUpDown.DomainUpDownItemCollection 클래스

정의

DomainUpDown 클래스에서 사용할 개체의 컬렉션을 캡슐화합니다.

public: ref class DomainUpDown::DomainUpDownItemCollection : System::Collections::ArrayList
public class DomainUpDown.DomainUpDownItemCollection : System.Collections.ArrayList
type DomainUpDown.DomainUpDownItemCollection = class
    inherit ArrayList
Public Class DomainUpDown.DomainUpDownItemCollection
Inherits ArrayList
상속
DomainUpDown.DomainUpDownItemCollection

예제

다음 예제를 만들고 초기화는 DomainUpDown 제어 합니다. 이 예제에서는 일부 속성을 설정 하 고 위로 / 아래로 컨트롤에 표시할 문자열 컬렉션을 만들 수 있습니다. 가정 코드를 TextBox, CheckBoxButton 양식의 인스턴스화된 합니다. 이 예제에서는 또한 라는 32 비트 부호 있는 정수로 선언 된 클래스 수준에서 멤버 변수 있다고 가정 myCounter합니다. 텍스트 상자에 문자열을 입력 하 고 추가 Items 단추를 클릭할 때 컬렉션입니다. 확인란을 클릭 하 여 전환할 수 있습니다는 Sorted 속성 위로 / 아래로 컨트롤의 항목 컬렉션의 차이 관찰 합니다.

protected:
   DomainUpDown^ domainUpDown1;

private:
   void InitializeMyDomainUpDown()
   {
      // Create and initialize the DomainUpDown control.
      domainUpDown1 = gcnew DomainUpDown;
      
      // Add the DomainUpDown control to the form.
      Controls->Add( domainUpDown1 );
   }

   void button1_Click( Object^ sender,
      EventArgs^ e )
   {
      // Add the text box contents and initial location in the collection
      // to the DomainUpDown control.
      domainUpDown1->Items->Add( String::Concat(
         (textBox1->Text->Trim()), " - ", myCounter ) );
      
      // Increment the counter variable.
      myCounter = myCounter + 1;
      
      // Clear the TextBox.
      textBox1->Text = "";
   }

   void checkBox1_Click( Object^ sender,
      EventArgs^ e )
   {
      
      // If Sorted is set to true, set it to false; 
      // otherwise set it to true.
      domainUpDown1->Sorted =  !domainUpDown1->Sorted;
   }

   void domainUpDown1_SelectedItemChanged( Object^ sender,
      EventArgs^ e )
   {
      
      // Display the SelectedIndex and 
      // SelectedItem property values in a MessageBox.
      MessageBox::Show( String::Concat( "SelectedIndex: ", domainUpDown1->SelectedIndex,
         "\nSelectedItem: ", domainUpDown1->SelectedItem ) );
   }
protected DomainUpDown domainUpDown1;

private void InitializeMyDomainUpDown()
 {
    // Create and initialize the DomainUpDown control.
    domainUpDown1 = new DomainUpDown();
    
    // Add the DomainUpDown control to the form.
    Controls.Add(domainUpDown1);
 }
 
 private void button1_Click(Object sender, 
                           EventArgs e)
 {   
    // Add the text box contents and initial location in the collection
    // to the DomainUpDown control.
    domainUpDown1.Items.Add((textBox1.Text.Trim()) + " - " + myCounter);
    
    // Increment the counter variable.
    myCounter = myCounter + 1;
 
    // Clear the TextBox.
    textBox1.Text = "";
 }
 
 private void checkBox1_Click(Object sender, 
                             EventArgs e)
 {
    // If Sorted is set to true, set it to false; 
    // otherwise set it to true.
    if (domainUpDown1.Sorted)
    {
       domainUpDown1.Sorted = false;
    }
    else
    {
       domainUpDown1.Sorted = true;
    }
 }
 
 private void domainUpDown1_SelectedItemChanged(Object sender, 
                                               EventArgs e)
 {
    // Display the SelectedIndex and 
    // SelectedItem property values in a MessageBox.
    MessageBox.Show("SelectedIndex: " + domainUpDown1.SelectedIndex.ToString() 
       + "\n" + "SelectedItem: " + domainUpDown1.SelectedItem.ToString());
 }
Protected domainUpDown1 As DomainUpDown


Private Sub InitializeMyDomainUpDown()
    ' Create and initialize the DomainUpDown control.
    domainUpDown1 = New DomainUpDown()
    
    ' Add the DomainUpDown control to the form.
    Controls.Add(domainUpDown1)
End Sub


Private Sub button1_Click(sender As Object, e As EventArgs)
    ' Add the text box contents and initial location in the collection
    ' to the DomainUpDown control.
    domainUpDown1.Items.Add((textBox1.Text.Trim() & " - " & myCounter))
    
    ' Increment the counter variable.
    myCounter = myCounter + 1
    
    ' Clear the TextBox.
    textBox1.Text = ""
End Sub


Private Sub checkBox1_Click(sender As Object, e As EventArgs)
    ' If Sorted is set to true, set it to false; 
    ' otherwise set it to true.
    If domainUpDown1.Sorted Then
        domainUpDown1.Sorted = False
    Else
        domainUpDown1.Sorted = True
    End If
End Sub


Private Sub domainUpDown1_SelectedItemChanged _
    (sender As Object, e As EventArgs)
    
    ' Display the SelectedIndex and 
    ' SelectedItem property values in a MessageBox.
    MessageBox.Show(("SelectedIndex: " & domainUpDown1.SelectedIndex.ToString() & _
        ControlChars.Cr & "SelectedItem: " & domainUpDown1.SelectedItem.ToString()))
End Sub

설명

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

속성

Capacity

ArrayList에 포함될 수 있는 요소의 수를 가져오거나 설정합니다.

(다음에서 상속됨 ArrayList)
Count

ArrayList에 실제로 포함된 요소의 수를 가져옵니다.

(다음에서 상속됨 ArrayList)
IsFixedSize

ArrayList의 크기가 고정되어 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 ArrayList)
IsReadOnly

ArrayList가 읽기 전용인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 ArrayList)
IsSynchronized

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

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

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

SyncRoot

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

(다음에서 상속됨 ArrayList)

메서드

Add(Object)

지정된 개체를 컬렉션의 끝에 추가합니다.

AddRange(ICollection)

ICollection의 요소를 ArrayList의 끝에 추가합니다.

(다음에서 상속됨 ArrayList)
BinarySearch(Int32, Int32, Object, IComparer)

지정된 비교자를 사용하여 정렬된 ArrayList의 요소 범위에서 요소를 검색하고 요소의 인덱스(0부터 시작)를 반환합니다.

(다음에서 상속됨 ArrayList)
BinarySearch(Object)

기본 비교자를 사용하여 정렬된 전체 ArrayList에서 요소를 검색하고 요소의 인덱스(0부터 시작)를 반환합니다.

(다음에서 상속됨 ArrayList)
BinarySearch(Object, IComparer)

지정된 비교자를 사용하여 정렬된 전체 ArrayList에서 요소를 검색하고 요소의 인덱스(0부터 시작)를 반환합니다.

(다음에서 상속됨 ArrayList)
Clear()

ArrayList에서 요소를 모두 제거합니다.

(다음에서 상속됨 ArrayList)
Clone()

ArrayList의 부분 복사본을 만듭니다.

(다음에서 상속됨 ArrayList)
Contains(Object)

ArrayList에 요소가 있는지 여부를 확인합니다.

(다음에서 상속됨 ArrayList)
CopyTo(Array)

대상 배열의 맨 처음부터 시작하여 전체 ArrayList를 호환되는 1차원 Array에 복사합니다.

(다음에서 상속됨 ArrayList)
CopyTo(Array, Int32)

대상 배열의 지정된 인덱스에서 시작하여 전체 ArrayList을 호환되는 1차원 Array에 복사합니다.

(다음에서 상속됨 ArrayList)
CopyTo(Int32, Array, Int32, Int32)

대상 배열의 지정한 인덱스에서 시작하여 ArrayList의 요소 범위를 호환되는 1차원 Array에 복사합니다.

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

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

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

전체 ArrayList에 대한 열거자를 반환합니다.

(다음에서 상속됨 ArrayList)
GetEnumerator(Int32, Int32)

ArrayList의 요소 범위에 대한 열거자를 반환합니다.

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

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

(다음에서 상속됨 Object)
GetRange(Int32, Int32)

소스 ArrayList에서 요소의 하위 집합을 나타내는 ArrayList를 반환합니다.

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

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

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

지정한 Object를 검색하고, 전체 ArrayList 내에서 처음 나오는 0부터 시작하는 인덱스를 반환합니다.

(다음에서 상속됨 ArrayList)
IndexOf(Object, Int32)

지정된 Object를 검색하고, 지정된 인덱스부터 마지막 요소까지 포함되는 ArrayList의 요소 범위에서 처음 나오는 0부터 시작하는 인덱스를 반환합니다.

(다음에서 상속됨 ArrayList)
IndexOf(Object, Int32, Int32)

지정된 Object를 검색하고, 지정된 인덱스부터 시작하여 지정된 수의 요소를 포함하는 ArrayList의 요소 범위에서 처음 나오는 0부터 시작하는 인덱스를 반환합니다.

(다음에서 상속됨 ArrayList)
Insert(Int32, Object)

지정된 위치에서 컬렉션에 지정된 개체를 삽입합니다.

InsertRange(Int32, ICollection)

ArrayList의 지정된 인덱스에 컬렉션의 요소를 삽입합니다.

(다음에서 상속됨 ArrayList)
LastIndexOf(Object)

지정한 Object 검색하고, 전체 ArrayList 내에서 마지막으로 검색된 항목의 0부터 시작하는 인덱스를 반환합니다.

(다음에서 상속됨 ArrayList)
LastIndexOf(Object, Int32)

지정된 Object를 검색하고, 첫 번째 요소부터 지정된 인덱스까지 확장되는 ArrayList의 요소 범위에서 마지막으로 검색된 항목의 0부터 시작하는 인덱스를 반환합니다.

(다음에서 상속됨 ArrayList)
LastIndexOf(Object, Int32, Int32)

지정된 Object를 검색하며, 지정된 수의 요소를 포함하고 지정된 인덱스에서 끝나는 ArrayList의 요소 범위에서 마지막으로 검색되는 0부터 시작하는 인덱스를 반환합니다.

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

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

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

컬렉션에서 지정한 항목을 제거합니다.

RemoveAt(Int32)

컬렉션의 지정된 위치에서 해당 항목을 제거합니다.

RemoveRange(Int32, Int32)

ArrayList에서 요소의 범위를 제거합니다.

(다음에서 상속됨 ArrayList)
Reverse()

전체 ArrayList에서 요소의 순서를 반대로 바꿉니다.

(다음에서 상속됨 ArrayList)
Reverse(Int32, Int32)

지정된 범위에서 요소의 순서를 반대로 바꿉니다.

(다음에서 상속됨 ArrayList)
SetRange(Int32, ICollection)

ArrayList의 요소 범위에 대해 컬렉션의 요소를 복사합니다.

(다음에서 상속됨 ArrayList)
Sort()

전체 ArrayList의 요소를 정렬합니다.

(다음에서 상속됨 ArrayList)
Sort(IComparer)

지정된 비교자를 사용하여 전체 ArrayList에 있는 요소를 정렬합니다.

(다음에서 상속됨 ArrayList)
Sort(Int32, Int32, IComparer)

지정된 비교자를 사용하여 ArrayList의 요소 범위에 있는 요소를 정렬합니다.

(다음에서 상속됨 ArrayList)
ToArray()

ArrayList의 요소를 새 Object 배열에 복사합니다.

(다음에서 상속됨 ArrayList)
ToArray(Type)

ArrayList의 요소를 지정된 요소 형식의 새 배열에 복사합니다.

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

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

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

용량을 ArrayList의 실제 요소 수로 설정합니다.

(다음에서 상속됨 ArrayList)

확장 메서드

Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable)

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

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상

추가 정보