void niTrayIcon_MouseUp(Object sender, System.Windows.Forms.MouseEventArgs e) { pmnuTrayMenu.DestroyHandle(); pmnuTrayMenu.Dismiss(); if (e.Button == MouseButtons.Right) { MenuCommand mcSelected = pmnuTrayMenu.TrackPopup(Cursor.Position); } }