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

📄 inputmoneyunit.pas

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

interface

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

type
  TGetMoneyForm = class(TForm)
    Image1: TImage;
    MaskEdit1: TMaskEdit;
    TitelLabel: TLabel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
  private
     { Private declarations }
  public
    { Public declarations }
  end;

var
  GetMoneyForm: TGetMoneyForm;
  Tit:string;
function GetMoney(T:PChar):double;stdcall;
//Procedure MyShow(S:PChar);stdcall;

implementation
{$R *.dfm}

//Procedure MyShow(S:PChar);stdcall;
//begin
//  MessageBox(0,S,'',mb_OK);
//end;


function GetMoney(T:PChar):double;stdcall;
var
  Temp:string;
begin
  Result:=0.00;
  if MessageBox(0,T,'确认',MB_YesNo
             +MB_DEFBUTTON1+MB_IconAsterisk+MB_ApplModal)=IDYES then
  begin
    try
      GetMoneyForm:= TGetMoneyForm.Create (Application);
      try
        with GetMoneyForm do
        begin
          if ShowModal = mrOK then
          begin
            //Caption:=T;
            Temp:=MaskEdit1.Text;
            try
              Result:=StrToFloat(Temp);
            except on E:EConvertError do
              MessageDlg ('输入错误:'+E.Message, mtError,[mbOK],0);
            end;
          end;
        end;
      finally
        GetMoneyForm.Free;
      end;
    except on E: Exception do
      MessageDlg ('DLL出现错误:'+E.Message, mtError,[mbOK],0);
    end;
  end;
end;
end.

⌨️ 快捷键说明

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