星期四, 11月 17, 2011

combobox自動展開及關閉

新增cxcombobox,並加上item值,再加入下列事件:
procedure TForm1.cxComboBox1MouseEnter(Sender: TObject);
begin
  cxComboBox1.DroppedDown:=true;
end;

procedure TForm1.FormMouseEnter(Sender: TObject);
begin
  cxComboBox1.DroppedDown:=false;
end;