private void button2_Click(object sender, EventArgs e) { path_Namespace = Module[1].Substring(0, (Module[1].Length - 4)); Assembly assembly = Assembly.LoadFile(path + @"\" + Module[1]); Object obj = assembly.CreateInstance(path_Namespace + "." + Forms[1]); modul = obj as BasisModulForm; for (int i = 0; i < Verwaltung.Count; i++) { if (Verwaltung[i].Form.GetType() == modul.GetType()) { tabControl1.SelectedTab = Verwaltung[i].Tabpage; return; } } TabPage tabpage = new TabPage { Text = button2.Text }; modul.Patient = Currentpatient; tabControl1.TabPages.Add(tabpage); tabControl1.SelectedTab = tabpage; modul.TopLevel = false; modul.Parent = tabpage; modul.Show(); modul.Dock = DockStyle.Fill; Delete.Enabled = true; Verwaltung.Add(new VerwaltungForms(modul, tabpage)); }
public Hauptfenster() { InitializeComponent(); modul = new BasisModulForm(); int startWith = start(); loadPatients(startWith); loadModules(startWith); foreach (var item in Patienten) { comboBox1.Items.Add(item); } }
public VerwaltungForms(BasisModulForm f, TabPage t) { this.Form = f; this.Tabpage = t; }