function ShowCalendar(var ADate: string): Boolean;
begin
FrmCalendar:= TFrmCalendar.Create(Application);
try
Result:= FrmCalendar.ShowModal=mrOk;
if Result then
ADate:= DateToStr(FrmCalendar.Calendar1.CalendarDate);
finally
FrmCalendar.Free;
FrmCalendar:=nil;
end;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
s: string;
begin
if ShowCalendar(s) then
Table1.FieldByName('날짜').AsString:= s;
end;
안녕하세요.
아래는 간단한 예제입니다. 참고 하시기 바랍니다.
function ShowCalendar(var ADate: string): Boolean;
begin
FrmCalendar:= TFrmCalendar.Create(Application);
try
Result:= FrmCalendar.ShowModal=mrOk;
if Result then
ADate:= DateToStr(FrmCalendar.Calendar1.CalendarDate);
finally
FrmCalendar.Free;
FrmCalendar:=nil;
end;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
s: string;
begin
if ShowCalendar(s) then
Table1.FieldByName('날짜').AsString:= s;
end;
도움이 되시길..