哪一种情况下,我应该用它来弹出一个登录表单? [英] Which form event should I use to pop up a login form?

查看:172
本文介绍了哪一种情况下,我应该用它来弹出一个登录表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在用户利用的主要形式,我想纠缠他们输入自己的用户名,密码和siteNumber。

Before the user makes use of the main form, I want to pester them to enter their username, password, and siteNumber.

我应该调用ShowDialog的登录表单从主窗体的Load(),()激活,的GotFocus(),或验证()事件?或者我应该只是从主窗体的构造函数调用的登录表单?

Should I invoke a ShowDialog on the login form from the Main form's Load(), Activated(), GotFocus(), or Validate() events? Or should I just invoke the login form from the main form's constructor?

这是一个Windows CE的应用程序,而这些都是我唯一的选择,事件明智的(没有显示的事件)。

This is a Windows CE app, and those are the only options I have, event-wise (there is no "Shown" event).

推荐答案

你有没有考虑通过的ShowDialog 提示的的,你甚至可以到主形成?

Have you considered prompting via ShowDialog before you even get to the main form?

把code就在主要()某处的Application.Run之前(新的MainForm())。

Put the code right in the Main() someplace before the Application.Run(new MainForm()).

工作得很好,我已经这样做过。

Works fine, I've done this before.

这篇关于哪一种情况下,我应该用它来弹出一个登录表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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