WinForms dialogs with TopMost = true
问题 I have a dialog implemented in WinForms that is shown as a notify dialog on the bottom right of the screen. The problem is that whenever is shown it takes the focus and this happens only when TopMost = true. How can I solve this? 回答1: You need to inherit from Form and override a couple of properties: [Flags] enum WS_EX { TOPMOST = 0x00000008, } class TopMostForm : Form { protected override CreateParams CreateParams { get { var baseParams = base.CreateParams; baseParams.ExStyle |= (int)WS_EX