luucm Posted January 26 Share Posted January 26 I use 2 event 1. After Post DiChuyen ='OK'; 2. Keydown procedure TfrmPhieuNXK.Grid_ChiTietKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if (DiChuyen ='OK') and (Key <> VK_UP) and (Key <> VK_DOWN) and (Key <> VK_LEFT) and (Key <> VK_RIGHT) then begin FDQueryDMNVL_d.Edit; // Kiểm tra trạng thái của Caps Lock if GetKeyState(VK_CAPITAL) <> 0 then begin // Chuyển đổi ký tự sang chữ thường nếu Caps Lock được kích hoạt GiaTriDauTien := Char(Key); end else begin GiaTriDauTien := LowerCase(Char(Key)); end; if ssShift in Shift then begin GiaTriDauTien := ''; end; // Hiển thị giá trị đã lưu FDQueryDMNVL_d.FieldByName(Grid_ChiTiet.Columns[Grid_ChiTiet.CurrCol].FieldName).AsString := GiaTriDauTien; DiChuyen := ''; end; end; Hope it can help you guys! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.