简体   繁体   English

如何加载表单但又不致于失去焦点?

[英]How to load a form but without stealing focus?

When my C# app runs I want it to start minimized and to show on the taskbar but without stealing the focus from the current app (to load in background). 当我的C#应用​​程序运行时,我希望它开始最小化并显示在任务栏上,但又不占用当前应用程序的焦点(在后台加载)。

I tried this but it doesn't work in Windows 10: 我尝试了此操作,但在Windows 10中不起作用:

protected override bool ShowWithoutActivation
{
    get { return true; }
}

Any advice? 有什么建议吗?

设置窗体的WindowState = Minimized应该足够了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM