LabelEditEventArgs.Item 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
편집할 레이블이 포함된 인덱스(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