当应用程序启动时我会对它进行网络实时检查,它会在等待时显示一个表单,就在这里
但是当我编译并运行它时,表单错过了文本标签
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Connecting c = new Connecting();//This is the waiting form
c.Show();
if (UsefulClass.Ping("www.google.com") == false) {
c.Close();
return;
}
frmV38 login = new frmV38();
if (login.ShowDialog() == DialogResult.OK)
{
login.Close();
Application.Run(new frmMain());
}
else {
Application.Exit();
}
}
Connecting.cs
public partial class Connecting : Form
{
public Connecting()
{
InitializeComponent();
}
private void Connecting_Load(object sender, EventArgs e)
{
}
}
谢谢
答案 0 :(得分:0)
您是否缺少InitializeComponent()?在您的连接表单的构造函数?
答案 1 :(得分:0)
Application.DoEvents();
之后
c.Show();