ListControl.FormatStringChanged Evento

Definizione

Si verifica quando il valore della proprietà FormatString viene modificato.

public:
 event EventHandler ^ FormatStringChanged;
public event EventHandler FormatStringChanged;
public event EventHandler? FormatStringChanged;
member this.FormatStringChanged : EventHandler 
Public Custom Event FormatStringChanged As EventHandler 

Tipo evento

Esempio

Nell'esempio di codice seguente viene illustrato l'uso di questo membro. Nell'esempio un gestore eventi segnala l'occorrenza dell'evento FormatStringChanged . Questo report consente di apprendere quando si verifica l'evento e può essere utile per eseguire il debug. Per segnalare più eventi o eventi che si verificano spesso, è consigliabile sostituire MessageBox.Show con Console.WriteLine o aggiungere il messaggio a una multilinea TextBox.

Per eseguire il codice di esempio, incollarlo in un progetto contenente un'istanza di un tipo che eredita da ListControl, ad esempio un ComboBox oggetto o ListBox. Assegnare quindi un nome all'istanza ListControl1 e assicurarsi che il gestore eventi sia associato all'evento FormatStringChanged .

private void ListControl1_FormatStringChanged(Object sender, EventArgs e) {

   MessageBox.Show("You are in the ListControl.FormatStringChanged event.");
}
Private Sub ListControl1_FormatStringChanged(sender as Object, e as EventArgs) _ 
     Handles ListControl1.FormatStringChanged

   MessageBox.Show("You are in the ListControl.FormatStringChanged event.")

End Sub

Commenti

Per ulteriori informazioni sulla gestione degli eventi, consultare gestione e generazione di eventi.

Si applica a