procedure TForm1.ComboBox1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
i: integer;
begin
// 加上这两句可以控制仅Ctrl按下的情况
// if not (ssCtrl in Shift) then
// exit;
i := ComboBox1.ItemIndex;
case Key of
VK_UP:
begin
if i>0 then
begin
ComboBox1.Items.Move(i, i-1);
end;
end;
VK_DOWN:
begin
if i<ComboBox1.Items.Count-1 then
begin
ComboBox1.Items.Move(i, i+1);
ComboBox1.ItemIndex := i;
end;
end;
end;
end;