private void button1_Click(object sender, EventArgs e) { int cmbPos = txtartcourse.SelectedIndex; addcourse ac = new addcourse(); ac.ShowDialog(); Courses co = new Courses(); DataTable dtname = new DataTable(); dtname = co.Search("SELECT coursename FROM courses"); txtartcourse.DataSource = dtname; txtartcourse.DisplayMember = "coursename"; txtartcourse.ValueMember = "coursename"; txtartcourse.SelectedIndex = cmbPos; }
private void پورتالاطلاعاتدورههایهنریToolStripMenuItem_Click(object sender, EventArgs e) { bool IsOpen = false; foreach (Form f in Application.OpenForms) { if (f.GetType() == typeof(addcourse)) { IsOpen = true; f.Focus(); break; } } if (IsOpen == false) { addcourse fmi = new addcourse(); fmi.MdiParent = this; fmi.Show(); } }