ListBox.ObjectCollection.Insert(Int32, Object) 메서드

정의

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

public:
 virtual void Insert(int index, System::Object ^ item);
public:
 void Insert(int index, System::Object ^ item);
public void Insert (int index, object item);
abstract member Insert : int * obj -> unit
override this.Insert : int * obj -> unit
member this.Insert : int * obj -> unit
Public Sub Insert (index As Integer, item As Object)

매개 변수

index
Int32

항목이 삽입되는 0부터 시작하는 인덱스 위치입니다.

item
Object

삽입할 항목을 나타내는 개체입니다.

구현

예외

index 매개 변수가 0보다 작거나 ListBox.ObjectCollection 클래스의 Count 속성 값보다 큰 경우

item이(가) null인 경우

설명

이 메서드를 사용하면 항목을 내의 특정 위치에 삽입할 수 있습니다 ListBox. 속성 ListBoxSorted true로 설정되면 매개 변수에 지정된 값에 관계없이 정렬된 목록 내의 올바른 위치에 항목이 index 추가됩니다. 개체가 컬렉션 ListBox 에 추가되면 먼저 클래스의 ListControl 속성에 항목 텍스트를 가져올 때 참조하도록 지정된 개체의 멤버 이름이 있는지 DisplayMember 확인합니다. 속성에 DisplayMember 지정된 ListBox 멤버가 없는 경우 개체의 메서드를 ToString 호출하여 목록에 표시할 텍스트를 가져옵니다.

적용 대상