private void txtMaMon_TextChanged(object sender, EventArgs e) { foreach (MonHoc mh in bulMH.layTatMonHoc()) { if (mh.MaMon == txtMaMon.Text) { txtTenMon.Text = mh.TenMon; txtSoTiet.Text = mh.SoTiet + ""; break; } } }
void hienCBTenMon_PhanCong() { cbMonHoc.DataSource = monHocBUL.layTatMonHoc(); cbMonHoc.DisplayMember = "tenMon"; cbMonHoc.ValueMember = "maMon"; }