Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个程序的表单设置为 TopMost = true,但由于某种原因,当它运行时,表单不再是 TopMost 表单。在我的代码中,没有任何东西可以修改表单的这个属性,所以我不知道是什么原因造成的。
Winforms 中的 TopMost 属性是否存在可能导致此问题的已知错误?还要别的吗?
您的最顶层窗口不能是其他窗口的所有者,以便最顶层能够按预期运行。检查是否_topmost_form.OwnedForms为空。如果不是,请尝试使用_topmost_form.RemoveOwnedForm(_any_owned_forms).
_topmost_form.OwnedForms
_topmost_form.RemoveOwnedForm(_any_owned_forms)