如何在C#应用程序中打开表单时不会窃取焦点 [英] How to make a form not stealing focus when it is opened in C# application

查看:69
本文介绍了如何在C#应用程序中打开表单时不会窃取焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi

I am developing project in c#(Windows Application). 
From Mdi form,
I am calling a form 'Form1'.
'Form1' should not not steal focus,when it is opened.
The cursor should be in previously opened form. 

Please help me.

Thanks
Chandran.





我的尝试:



我试图让表格不要在c#application中隐藏焦点



What I have tried:

I tried to make a form not to steal focus in c# application

推荐答案

你打电话给Show后在新表格上,将焦点调用旧表格,它将保留用户输入。
After you call Show on the new Form, call Focus on the "old" form and it will retain the user input.


尝试,从mdi表格

try, from mdi form
Form2 obj = new Form2();
           obj.Show();
           this.Focus();


这篇关于如何在C#应用程序中打开表单时不会窃取焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆