我的主表单中有一些代码,一旦项目启动就会加载另一个表单:
private void Form1_Load(object sender, EventArgs e)
{
Updating upd = new Updating();
upd.Show();
}
这个新表单(当前)只包含以下代码:
private void Updating_Load(object sender, EventArgs e)
{
this.BackgroundImage = Properties.Resources.updating1;
Stopwatch dw = new Stopwatch();
dw.Start();
bool qsdf = true;
while (qsdf)
{
if (dw.ElapsedMilliseconds >= 3000) qsdf = false; dw.Stop();
}
this.BackgroundImage = Properties.Resources.updating2;
Stopwatch sw = new Stopwatch();
sw.Start();
qsdf = true;
while (qsdf)
{
if (sw.ElapsedMilliseconds >= 3000) qsdf = false; sw.Stop();
}
this.Close();
现在,由于某种原因,被调用的表单(form called Updating
)根本不显示。目前发生的所有事情是在我显示主表单之前的 6 秒内(如秒表所示)我什么也没得到,甚至一次都没有看到更新表单。
注意:这是我的 Updating.Designer.cs 中绘制所有组件的代码:
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = global::BossCraftLauncher.Properties.Resources.updating1;
this.ClientSize = new System.Drawing.Size(300, 100);
this.ControlBox = false;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Updating";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "BCL Update";
this.Load += new System.EventHandler(this.Updating_Load);
this.ResumeLayout(false);