ToolStripDropDown.ChangeUICues Событие

Определение

Происходит при получении сигналов на изменение от фокуса или клавиатурного интерфейса.

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 

Тип события

Атрибуты

Примеры

В следующем примере кода показано использование этого элемента. В этом примере обработчик событий сообщает о возникновении ChangeUICues события. Этот отчет поможет вам узнать, когда происходит событие, и поможет вам в отладке. Чтобы сообщить о нескольких событиях или о событиях, которые происходят часто, рекомендуется заменить MessageBox.ShowConsole.WriteLine сообщение или добавить его в многостроочный TextBox.

Чтобы выполнить пример кода, вставьте его в проект, содержащий экземпляр типа ToolStripDropDown с именем ToolStripDropDown1. Затем убедитесь, что обработчик событий связан с событием ChangeUICues .

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

Комментарии

Дополнительные сведения об обработке событий см. в разделе Обработка и вызов событий.

Применяется к