procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key = VK_NUMPAD2 then edit1.Text := 's';
end;
执行后,edit中会出现'2s'这种,怎么能使edit中不响应小键盘事件,然后对小键盘相应按键进行处理。
谢谢。
不要告诉我在edit1keyup中写事件,不好用。
Shift: TShiftState);
begin
if key = VK_NUMPAD2 then edit1.Text := 's';
end;
执行后,edit中会出现'2s'这种,怎么能使edit中不响应小键盘事件,然后对小键盘相应按键进行处理。
谢谢。
不要告诉我在edit1keyup中写事件,不好用。
if key=#13 then
begin
..
end;
你可以把小键盘中的各个键 的
begin
..
Key := ' ';
end;
if key= '2' then
begin
..
Key := ' ';
end;
........
Shift: TShiftState);
begin
if key = VK_NUMPAD2 then Key := 's';//<-------------一定要将key赋值才可以
end;
执行后,edit中会出现'2s'这种,怎么能使edit中不响应小键盘事件,然后对小键盘相应按键进行处理。
谢谢。
不要告诉我在edit1keyup中写事件,不好用。