private void bteLoai_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { frmLookUp_Loai frmLookUp = new frmLookUp_Loai(String.Format("%{0}%", bteLoai.Text)); if (frmLookUp.ShowDialog(this) == DialogResult.OK) { bteLoai.Text = frmLookUp.SelectedItem.Ten; bteLoai.Tag = frmLookUp.SelectedItem; } }
private void bteLoai_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { frmLookUp_Loai frmLookUp = new frmLookUp_Loai(String.Format("%{0}%", bteLoai.Text)); if (frmLookUp.ShowDialog(this) == DialogResult.OK) { bteLoai.Text = frmLookUp.SelectedItem.Ten; bteLoai.Tag = frmLookUp.SelectedItem; } } }