⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inputdatetimeunit.pas

📁 很好地delphi书籍源码
💻 PAS
字号:
unit InputDateTimeUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ComCtrls, ExtCtrls;

type
  TGetTimeForm = class(TForm)
    DateMC: TMonthCalendar;
    TimeP: TPanel;
    TimeDTP: TDateTimePicker;
    OkBitBtn: TBitBtn;
    CancelBitBtn: TBitBtn;
    Label1: TLabel;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  GetTimeForm: TGetTimeForm;
  function GetMyDateTime:TDateTime; stdcall;
implementation
{$R *.dfm}

function GetMyDateTime:TDateTime ;
var
  Temp:string;
begin
  result:=Now;
  try
    GetTimeForm := TGetTimeForm.Create (Application);
    try
      with  GetTimeForm  do
      begin
        if ShowModal = mrOK then
        begin
          Temp:=DateToStr(DateMC.Date)+' '+TimeToStr(TimeDTP.Time);
          Result:=StrToDateTime(Temp);
        end;
      end;
    finally
      GetTimeForm.Free;
    end;
  except
    on E: Exception do
      MessageDlg ('DLL出现错误:'+E.Message, mtError,[mbOK],0);
  end;
end;


end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -