MDI 형식이 있고 프로그램을 시작할 때 열리는 자식 창은 항상 뒤로 이동합니다. MDT 형식의 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];
}
나는 대답은 당신이 당신의 [원래의 게시물]에서 mark_ (http://stackoverflow.com/questions/19189413/windows-forms-closing-immediately-when-opened)보다 정확한있다을 _didn't 생각 구현. – Brian