哪一种情况下,我应该用它来弹出一个登录表单?弹出、表单、哪一种、它来

2023-09-07 10:44:52 作者:抽风少女

在用户利用的主要形式,我想纠缠他们输入自己的用户名,密码和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.