function inFind(const ACaption, APrompt,ADateLabel:string;var Value:String;FDate,TDate:TDateTime):Boolean;
var FindForm:TForm;
Edit:TEdit;
Prompt,DateLabel: TLabel;
DateF,DateT:TDateTimePicker;
begin
Result := False;
FindForm := TForm.Create(Application);
with FindForm do
try
Left := 202;
Top := 374;
Width := 295;
Height := 186;
Font.Charset := GB2312_CHARSET;
Font.Name := '宋体';
Font.Size :=9;
Canvas.Font := Font;
BorderStyle := bsDialog;
Caption := ACaption;
Position := poScreenCenter; Prompt := TLabel.Create(FindForm);
with Prompt do
begin
Parent := FindForm;
Caption := APrompt;
Left := 24;
Top := 16;
Width := 96;
Height := 12;
WordWrap := True;
end; DateLabel:= TLabel.Create(FindForm);
with DateLabel do
begin
Parent := FindForm;
Caption := ADateLabel;
Left := 24;
Top := 61;
Width := 108;
Height := 12;
WordWrap := True;
end; Edit := TEdit.Create(FindForm);
with Edit do
begin
Parent := FindForm;
Left := 24;
Top := 33;
Width := 241;
Height := 20;
MaxLength := 255;
Text := Value;
SelectAll;
end; DateF:=TDateTimePicker.Create(FindForm);
with DateF do
begin
Parent := FindForm;
Left := 25;
Top := 79;
Width := 110;
Height := 20;
Date :=now;
DateMode := dmUpDown; end; DateT:=TDateTimePicker.Create(FindForm);
with DateT do
begin
Parent := FindForm;
Left := 150;
Top := 79;
Width := 117;
Height := 20;
Date := now;
DateMode := dmUpDown;
end; with TButton.Create(FindForm) do
begin
Parent := FindForm;
Caption := '确定';
ModalResult := mrOk;
Default := True;
Left := 73;
Top := 115;
Width := 75;
Height := 25;
end; with TButton.Create(FindForm) do
begin
Parent := FindForm;
Caption := '取消';
ModalResult := mrCancel;
Cancel := True;
Left := 153;
Top := 115;
Width := 75;
Height := 25;
end;
if ShowModal = mrOk then
begin
Value := Edit.Text;
FDate:= DateF.Date;
TDate:= DateT.Date;
Result := True;
end;
finally
FindForm.Free;
end;
end;当用该窗体,退出后,如何得到TDateTimePicker的更改日期值
var FindForm:TForm;
Edit:TEdit;
Prompt,DateLabel: TLabel;
DateF,DateT:TDateTimePicker;
begin
Result := False;
FindForm := TForm.Create(Application);
with FindForm do
try
Left := 202;
Top := 374;
Width := 295;
Height := 186;
Font.Charset := GB2312_CHARSET;
Font.Name := '宋体';
Font.Size :=9;
Canvas.Font := Font;
BorderStyle := bsDialog;
Caption := ACaption;
Position := poScreenCenter; Prompt := TLabel.Create(FindForm);
with Prompt do
begin
Parent := FindForm;
Caption := APrompt;
Left := 24;
Top := 16;
Width := 96;
Height := 12;
WordWrap := True;
end; DateLabel:= TLabel.Create(FindForm);
with DateLabel do
begin
Parent := FindForm;
Caption := ADateLabel;
Left := 24;
Top := 61;
Width := 108;
Height := 12;
WordWrap := True;
end; Edit := TEdit.Create(FindForm);
with Edit do
begin
Parent := FindForm;
Left := 24;
Top := 33;
Width := 241;
Height := 20;
MaxLength := 255;
Text := Value;
SelectAll;
end; DateF:=TDateTimePicker.Create(FindForm);
with DateF do
begin
Parent := FindForm;
Left := 25;
Top := 79;
Width := 110;
Height := 20;
Date :=now;
DateMode := dmUpDown; end; DateT:=TDateTimePicker.Create(FindForm);
with DateT do
begin
Parent := FindForm;
Left := 150;
Top := 79;
Width := 117;
Height := 20;
Date := now;
DateMode := dmUpDown;
end; with TButton.Create(FindForm) do
begin
Parent := FindForm;
Caption := '确定';
ModalResult := mrOk;
Default := True;
Left := 73;
Top := 115;
Width := 75;
Height := 25;
end; with TButton.Create(FindForm) do
begin
Parent := FindForm;
Caption := '取消';
ModalResult := mrCancel;
Cancel := True;
Left := 153;
Top := 115;
Width := 75;
Height := 25;
end;
if ShowModal = mrOk then
begin
Value := Edit.Text;
FDate:= DateF.Date;
TDate:= DateT.Date;
Result := True;
end;
finally
FindForm.Free;
end;
end;当用该窗体,退出后,如何得到TDateTimePicker的更改日期值
解决方案 »
- 使用GetShareNetInfo获取本机共享目录的信息,请高手指点
- 将excel文件导入数据库的速度问题?
- fastreport3.15 是否有自定义的band,可以不依赖于Data而存在?谢谢!
- 问题多多啊,不好意思,等"项目"完了,我再结帖!另:如何对查询出的各列进行汇总?谢谢
- 一片混乱,OOP应该如何下手?来者有分!
- 关于Listview中multiselect如何显示选择数据的问题???
- 很久没散过分了﹐散点分慰劳各位﹗
- 如何使编写的软件界面布局不随显示器分辨率而变化?
- 在delphi什么控件能够实现类似于foxmail那样的邮件显示列表控件
- 老鱼,系统报错如下//牛虻
- 系统编程-CB_ADDSTRING
- 打印机偏移问题急。
function inFind(const ACaption, APrompt,ADateLabel:string;var Value:String;var FDate:TDateTime; var TDate:TDateTime):Boolean; //本行修改直接读取 Fdate, tdate 就可!