procedure TForm1.ComboBox1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin //189 is the key of - //and you can use showmessage(inttostr(key))get the + key's number if key = 189 then key :=vk_down; end;procedure TForm1.ComboBox1KeyPress(Sender: TObject; var Key: Char); begin if key = '-' then key := #0; end;
??? " onkeypress 里不可实现,因为如何也会在你的Combobox.text 上加上'+' 或'-'."helodd(可爱)的说法不对。idilent(不工作会发疯吗?) 的方法是正确的。 procedure TForm1.ComboBox1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin //189 is the key of - //and you can use showmessage(inttostr(key))get the + key's number if key = 189 then key :=vk_down; if key = 187 then key :=vk_up;
end;
procedure TForm1.ComboBox1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin //189 is the key of - //and you can use showmessage(inttostr(key))get the + key's number if key = 189 then key :=vk_up; if key = 187 then key :=vk_down;
key=上光标;就是这个意思/
key=上光标;就是这个意思/
Shift: TShiftState);
begin
//189 is the key of -
//and you can use showmessage(inttostr(key))get the + key's number
if key = 189 then
key :=vk_down;
end;procedure TForm1.ComboBox1KeyPress(Sender: TObject; var Key: Char);
begin
if key = '-' then
key := #0;
end;
procedure TForm1.ComboBox1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
//189 is the key of -
//and you can use showmessage(inttostr(key))get the + key's number
if key = 189 then
key :=vk_down; if key = 187 then
key :=vk_up;
end;
Shift: TShiftState);
begin
//189 is the key of -
//and you can use showmessage(inttostr(key))get the + key's number
if key = 189 then
key :=vk_up; if key = 187 then
key :=vk_down;
end;