DELPHI5.0的inputbox函数的原代码在什么路径下面,谢了!

解决方案 »

  1.   

    function InputQuery(const ACaption, APrompt: string;
      var Value: string): Boolean;
    var
      Form: TForm;
      Prompt: TLabel;
      Edit: TEdit;
      DialogUnits: TPoint;
      ButtonTop, ButtonWidth, ButtonHeight: Integer;
    begin
      Result := False;
      Form := TForm.Create(Application);
      with Form do
        try
          Canvas.Font := Font;
          DialogUnits := GetAveCharSize(Canvas);
          BorderStyle := bsDialog;
          Caption := ACaption;
          ClientWidth := MulDiv(180, DialogUnits.X, 4);
          Position := poScreenCenter;
          Prompt := TLabel.Create(Form);
          with Prompt do
          begin
            Parent := Form;
            Caption := APrompt;
            Left := MulDiv(8, DialogUnits.X, 4);
            Top := MulDiv(8, DialogUnits.Y, 8);
            Constraints.MaxWidth := MulDiv(164, DialogUnits.X, 4);
            WordWrap := True;
          end;
          Edit := TEdit.Create(Form);
          with Edit do
          begin
            Parent := Form;
            Left := Prompt.Left;
            Top := Prompt.Top + Prompt.Height + 5;
            Width := MulDiv(164, DialogUnits.X, 4);
            MaxLength := 255;
            Text := Value;
            SelectAll;
          end;
          ButtonTop := Edit.Top + Edit.Height + 15;
          ButtonWidth := MulDiv(50, DialogUnits.X, 4);
          ButtonHeight := MulDiv(14, DialogUnits.Y, 8);
          with TButton.Create(Form) do
          begin
            Parent := Form;
            Caption := SMsgDlgOK;
            ModalResult := mrOk;
            Default := True;
            SetBounds(MulDiv(38, DialogUnits.X, 4), ButtonTop, ButtonWidth,
              ButtonHeight);
          end;
          with TButton.Create(Form) do
          begin
            Parent := Form;
            Caption := SMsgDlgCancel;
            ModalResult := mrCancel;
            Cancel := True;
            SetBounds(MulDiv(92, DialogUnits.X, 4), Edit.Top + Edit.Height + 15,
              ButtonWidth, ButtonHeight);
            Form.ClientHeight := Top + Height + 13;          
          end;
          if ShowModal = mrOk then
          begin
            Value := Edit.Text;
            Result := True;
          end;
        finally
          Form.Free;
        end;
    end;function InputBox(const ACaption, APrompt, ADefault: string): string;
    begin
      Result := ADefault;
      InputQuery(ACaption, APrompt, Result);
    end;
      

  2.   

    你按住ctrl,然后再将鼠标移到你要看的函数名称上点一下就可以看到原代码了