LabelEditEventArgs.CancelEdit 속성

정의

ListViewItem의 레이블에 대한 변경 내용을 취소해야 할지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool CancelEdit { bool get(); void set(bool value); };
public bool CancelEdit { get; set; }
member this.CancelEdit : bool with get, set
Public Property CancelEdit As Boolean

속성 값

ListViewItem의 레이블에 대한 편집 작업을 취소해야 하면 true이고, 그렇지 않으면 false입니다.

예제

다음 코드 예제에서는 처리를 ListView.BeforeLabelEdit 이벤트 및 사용 하는 ItemCancelEdit 속성입니다. 예제를 실행 하려면 ListView 컨트롤 ListView1 라는 및 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

설명

레이블에 대 한 변경 내용을 취소 하려면이 속성을 사용할 수는 ListViewItem 원래 텍스트를 되돌리는 것입니다. 항목의 캡션을 애플리케이션의 요구 사항을 충족 하지 않는 값으로 변경 되지 않도록 방지 하기 위해이 속성을 사용 합니다.

적용 대상