展示对话与聚焦 [英] showdialog and focusing

查看:229
本文介绍了展示对话与聚焦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有2个窗体的C#Windows应用程序-form1和Login.
当应用程序启动时,我创建了一个新的form1.在Form1的Load事件处理程序中,我使用ShowDialog显示登录"表单.

Program.cs -Main
... Application .Run( Form1 ());
...

Form1_Load

I have a C# windows app with 2 forms- form1 and Login.
when the app starts, I create a new form1. In the Load eventhandler for form1, I show the Login form using ShowDialog.

Program.cs -Main
...Application.Run( new Form1() );
...

Form1_Load

推荐答案

在登录"表单中设置Form1_Load事件并执行 this.Activate();
In the LogIn form set up Form1_Load event and do this.Activate ( );


这篇关于展示对话与聚焦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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