private void Main_Load(object sender, EventArgs e) { timetable document = new timetable(); // Show document if (DockTabPanel.DocumentStyle == DocumentStyle.SystemMdi) { document.MdiParent = this; document.Show(); } else { document.Show(DockTabPanel); } }
private void generateButton_Click(object sender, EventArgs e) { string[][] timetable = controler.GenerateTimetable(); DataTable dt = new DataTable(); for (int i = 0; i < timetable[0].Length; i++) { dt.Columns.Add(i.ToString()); } for (int i = 0; i < timetable.Length; i++) { dt.LoadDataRow(timetable[i], true); } timetable document = new timetable(dt); if (DockTabPanel.DocumentStyle == DocumentStyle.SystemMdi) { document.MdiParent = this; document.Show(); } else { document.Show(DockTabPanel); } }