private void cmbTimTheo_SelectedIndexChanged(object sender, EventArgs e) { AutoCompleteStringCollection auto = new AutoCompleteStringCollection(); DataTable dt = new DataTable(); dt = HoaDon_BLL.LayMaHoaDon(); foreach (DataRow dr in dt.Rows) { if (cmbTimTheo.SelectedIndex == 0) { auto.Add(dr[0].ToString()); } } txtTuKhoa.AutoCompleteSource = AutoCompleteSource.CustomSource; txtTuKhoa.AutoCompleteMode = AutoCompleteMode.SuggestAppend; txtTuKhoa.AutoCompleteCustomSource = auto; }