LabelEditEventArgs.Item 속성

정의

편집할 레이블이 포함된 인덱스(0부터 시작하는 인덱 ListViewItem 스)를 가져옵니다.

public:
 property int Item { int get(); };
public int Item { get; }
member this.Item : int
Public ReadOnly Property Item As Integer

속성 값

의 인덱스(0부터 시작하는 인덱스)입니다 ListViewItem.

예제

다음 코드 예제에서는 이벤트를 처리 하 ListView.BeforeLabelEdit 고 및 Item 속성을 사용 하는 방법을 CancelEdit 보여 줍니다. 예제를 실행하려면 ListView1이라는 ListView 컨트롤이 포함된 양식에 다음 코드를 붙여넣고 3개 이상의 항목으로 채워집니다. 모든 이벤트가 해당 이벤트 처리 메서드와 연결되어 있는지 확인합니다.

void ListView1_BeforeLabelEdit( Object^ sender,
   System::Windows::Forms::LabelEditEventArgs^ e )
{
   // Allow all but the first two items of the list to 
   // be modified by the user.
   if ( e->Item < 2 )
   {
      e->CancelEdit = true;
   }
}
private void ListView1_BeforeLabelEdit(object sender, 
    System.Windows.Forms.LabelEditEventArgs e)
{
    // Allow all but the first two items of the list to 
    // be modified by the user.
    if (e.Item<2)
    {
        e.CancelEdit = true;
    }
}

Private Sub ListView1_BeforeLabelEdit(ByVal sender As Object, _
    ByVal e As System.Windows.Forms.LabelEditEventArgs) _
    Handles ListView1.BeforeLabelEdit

    ' Allow all but the first two items of the list to be modified by
    ' the user.
    If (e.Item < 2) Then
        e.CancelEdit = True
    End If
End Sub

적용 대상