Språk

ToolStripDropDown.ChangeUICues Event

Definition

Inträffar när fokus- eller tangentbordsanvändargränssnittets (UI) tips ändras.

public:
 event System::Windows::Forms::UICuesEventHandler ^ ChangeUICues;
[System.ComponentModel.Browsable(false)]
public event System.Windows.Forms.UICuesEventHandler ChangeUICues;
[System.ComponentModel.Browsable(false)]
public event System.Windows.Forms.UICuesEventHandler? ChangeUICues;
[<System.ComponentModel.Browsable(false)>]
member this.ChangeUICues : System.Windows.Forms.UICuesEventHandler 
Public Custom Event ChangeUICues As UICuesEventHandler 

Händelsetyp

Attribut

Exempel

Följande kodexempel visar hur den här medlemmen används. I exemplet rapporterar en händelsehanterare om händelsens ChangeUICues förekomst. Den här rapporten hjälper dig att lära dig när händelsen inträffar och kan hjälpa dig att felsöka. Om du vill rapportera om flera händelser eller händelser som inträffar ofta kan du överväga att MessageBox.Show ersätta med Console.WriteLine eller lägga till meddelandet i en flerradig TextBox.

Om du vill köra exempelkoden klistrar du in den i ett projekt som innehåller en instans av typen ToolStripDropDown med namnet ToolStripDropDown1. Kontrollera sedan att händelsehanteraren är associerad med ChangeUICues händelsen.

private void ToolStripDropDown1_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 ToolStripDropDown1_ChangeUICues(sender as Object, e as UICuesEventArgs) _ 
     Handles ToolStripDropDown1.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

Kommentarer

Mer information om hur du hanterar händelser finns i Hantera och höja händelser.

Gäller för