public void setLichThi(LichThi lh) { this.panel_lichthi.Controls.Clear(); Control ct = this.panel_lichthi.Controls["header_lichthi"]; if (ct != null) { this.panel_lichthi.Controls.Remove(ct); } listMT = lh.ds_mon_thi.ToArray <MonThi>(); for (int i = listMT.Length - 1; i >= 0; i--) { LichThiItem item = new LichThiItem(); item.ma_mon_hoc.Text = listMT[i].ma_mh; item.ten_mon_hoc.Text = listMT[i].ten_mh; item.nhom_to.Text = listMT[i].nhomto; item.phongGK.Text = listMT[i].phong_ktra; item.ngayGK.Text = listMT[i].ngaykt; item.gioGK.Text = listMT[i].gio_kt; item.phongCK.Text = listMT[i].phong_thi; item.ngayCK.Text = listMT[i].ngaythi; item.gioCK.Text = listMT[i].gio_thi; item.TabIndex = i; item.Dock = DockStyle.Top; this.panel_lichthi.Controls.Add(item); } setupHeader(); }
public void setupHeader() { LichThiItem lt = new LichThiItem(); setupHeader(lt.ma_mon_hoc); setupHeader(lt.ten_mon_hoc); setupHeader(lt.nhom_to); setupHeader(lt.phongGK); setupHeader(lt.gioGK); setupHeader(lt.ngayGK); setupHeader(lt.phongCK); setupHeader(lt.gioCK); setupHeader(lt.ngayCK); lt.Name = "header_lichthi"; lt.Dock = DockStyle.Top; this.panel_lichthi.Controls.Add(lt); }