我有一个 MDI 表单,当我启动程序时,打开的子窗口总是回到后面,我尝试在 MDI 表单上使用 sendtoback(),在子表单上尝试使用 bringtofront(),没有运气。任何人?
private void MDI_Form_Load(object sender, EventArgs e)
{
SendToBack();
Form1 loginscrn = new Form1();
loginscrn.Show();
}
private void Form1_Load(object sender, EventArgs e)
{
BringToFront();
SqlConnection connection = new SqlConnection(@"server=.\SQLEXPRESS; database=loginsTest;Trusted_Connection=yes");
connection.Open();
string selection = "select * from Logins where Name = '"+userNameBox.Text+"'";
SqlCommand command = new SqlCommand(selection, connection);
SqlDataAdapter da = new SqlDataAdapter(command);
DataSet ds = new DataSet();
da.Fill(ds);
DataTable dt = ds.Tables[0];
}