星期四, 3月 05, 2009

避免Delphi的TDateTimePicker的onChange事件會執行二次


procedure TForm1.DateTimePicker1Change(Sender: TObject);
begin
if (DateTimePicker1.DroppedDown) then
exit;
DateTimePicker1CloseUp(sender);
end;

procedure TForm1.DateTimePicker1CloseUp(Sender: TObject);
begin
//你不想執行二次的程式碼
end;

沒有留言: