방법: 프로그래밍 방식으로 Windows Forms DomainUpDown 컨트롤에 항목 추가
코드를 작성하여 Windows Forms DomainUpDown 컨트롤에 항목을 추가할 수 있습니다. 컨트롤의 Items 속성에 항목을 추가하려면 DomainUpDown.DomainUpDownItemCollection 클래스의 Add 또는 Insert 메서드를 호출합니다. Add 메서드는 컬렉션의 끝에 항목을 추가하고 Insert 메서드는 지정된 위치에 항목을 추가합니다.
새 항목을 추가하려면
Add 메서드를 사용하여 항목 목록의 끝에 항목을 추가합니다.
DomainUpDown1.Items.Add("noodles")
domainUpDown1.Items.Add("noodles");
domainUpDown1.get_Items().Add("noodles");
domainUpDown1->Items->Add("noodles");
또는
Insert 메서드를 사용하여 목록에서 지정된 위치에 항목을 삽입합니다.
' Inserts an item at the third position in the list DomainUpDown1.Items.Insert(2, "rice")
// Inserts an item at the third position in the list domainUpDown1.Items.Insert(2, "rice");
// Inserts an item at the third position in the list domainUpDown1.get_Items().Insert(2, "rice");
// Inserts an item at the third position in the list domainUpDown1->Items->Insert(2, "rice");
참고 항목
참조
DomainUpDown 컨트롤 개요(Windows Forms)
DomainUpDown.DomainUpDownItemCollection.Add