我需要首先加载主表单,然后将第二个表单作为对话框加载。当我尝试以下操作时,proFileDialog 加载,mnuForm 保持隐藏状态,直到我关闭 proFileDialog 我可以将它绑定到计时器,但是为了学习 c#,为什么它会乱序加载,以及如何让它表现得恰当?
private void mnuForm_Load(object sender, EventArgs e)
{
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
using (Form proFileDialog = new Form())
{
proFileDialog.Text = "Some new form";
proFileDialog.FormBorderStyle = FormBorderStyle.None;
proFileDialog.Opacity = 100;
proFileDialog.StartPosition = FormStartPosition.CenterScreen;
// form.Controls.Add(...);
proFileDialog.ShowDialog();
}
}