LabelEditEventArgs.Label Propiedad

Definición

Obtiene el nuevo texto asignado a la etiqueta de ListViewItem.

public:
 property System::String ^ Label { System::String ^ get(); };
public string Label { get; }
public string? Label { get; }
member this.Label : string
Public ReadOnly Property Label As String

Valor de propiedad

El nuevo texto que se va a asociar a ListViewItem o null si el texto no se va a modificar.

Ejemplos

En el ejemplo de código siguiente se muestra el uso de este miembro. En el ejemplo, un controlador de eventos informa sobre la aparición del ListView.AfterLabelEdit evento. Este informe le ayuda a aprender cuándo se produce el evento y puede ayudarle a depurar. Para informar sobre varios eventos o eventos que se producen con frecuencia, considere la posibilidad de reemplazar MessageBox.ShowConsole.WriteLine por o anexar el mensaje a una línea TextBoxmúltiple.

Para ejecutar el código de ejemplo, péguelo en un proyecto que contenga una instancia de tipo ListView denominada ListView1. A continuación, asegúrese de que el controlador de eventos está asociado al ListView.AfterLabelEdit evento.

private void ListView1_AfterLabelEdit(Object sender, LabelEditEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Label", e.Label );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Item", e.Item );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "CancelEdit", e.CancelEdit );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "AfterLabelEdit Event" );
}
Private Sub ListView1_AfterLabelEdit(sender as Object, e as LabelEditEventArgs) _ 
     Handles ListView1.AfterLabelEdit

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "Label", e.Label)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Item", e.Item)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "CancelEdit", e.CancelEdit)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"AfterLabelEdit Event")

End Sub

Se aplica a