Click event delayed in ContextMenu attached to NotifyIcon
问题 I am working on a plugin (using System.ComponentModel.Composition ) for an application to place an icon in the notification area of the Windows UI. trayMenu.MenuItems.Clear(); // Create context menu items foreach( IJob job in jobs ) { MenuItem menuItem = new MenuItem( job.Name ) {Tag = job}; menuItem.Click += MenuItemClick; trayMenu.MenuItems.Add( menuItem ); } private void MenuItemClick( object sender, EventArgs e ) { // ... } Now when I click on an item in the context menu of that icon, the