UICuesEventArgs.ChangeFocus Proprietà

Definizione

Ottiene un valore che indica se lo stato dei suggerimenti di attivazione è cambiato.

public:
 property bool ChangeFocus { bool get(); };
public bool ChangeFocus { get; }
member this.ChangeFocus : bool
Public ReadOnly Property ChangeFocus As Boolean

Valore della proprietà

true se lo stato dei suggerimenti di attivazione è cambiato; in caso contrario, false.

Esempio

Nell'esempio di codice seguente viene illustrato l'uso di questo membro. Nell'esempio un gestore eventi segnala l'occorrenza dell'evento Control.ChangeUICues . 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 Control, ad esempio un Button oggetto o ComboBox. Assegnare quindi un nome all'istanza Control1 e assicurarsi che il gestore eventi sia associato all'evento Control.ChangeUICues .

private void Control1_ChangeUICues(Object sender, UICuesEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "ShowFocus", e.ShowFocus );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ShowKeyboard", e.ShowKeyboard );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ChangeFocus", e.ChangeFocus );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ChangeKeyboard", e.ChangeKeyboard );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Changed", e.Changed );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "ChangeUICues Event" );
}
Private Sub Control1_ChangeUICues(sender as Object, e as UICuesEventArgs) _ 
     Handles Control1.ChangeUICues

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "ShowFocus", e.ShowFocus)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ShowKeyboard", e.ShowKeyboard)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ChangeFocus", e.ChangeFocus)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ChangeKeyboard", e.ChangeKeyboard)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Changed", e.Changed)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"ChangeUICues Event")

End Sub

Si applica a

Vedi anche