Exemplo n.º 1
0
        private void bteLoaiSanPham_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            frmLookUp_LoaiSanPham frm = new frmLookUp_LoaiSanPham(false, "%" + bteLoaiSanPham.Text.Trim() + "%");

            frm.ShowDialog();
            if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                bteLoaiSanPham.Text = frm.SelectedItem.TenLoaiSP;
                bteLoaiSanPham.Tag  = frm.SelectedItem;
            }
        }
 private void txtLoaiSanPham_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         frmLookUp_LoaiSanPham frm = new frmLookUp_LoaiSanPham(false, "%" + txtLoaiSanPham.Text.Trim() + "%");
         frm.ShowDialog();
         if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
         {
             txtLoaiSanPham.Text = frm.SelectedItem.TenLoaiSP;
             IdLoaiSanPham       = frm.SelectedItem.IdLoaiSP;
         }
     }
 }