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

📄 input.pas

📁 Delphi LDAP Authentication Component delphi ldap控件
💻 PAS
字号:
unit Input;

interface

uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, 
  Buttons, ExtCtrls;

type
  TInputDlg = class(TForm)
    OKBtn: TButton;
    CancelBtn: TButton;
    Edit: TEdit;
    Prompt: TLabel;
    procedure EditChange(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

function InputDlg(ACaption, APrompt: string; var AValue: string; PasswordChar: Char=#0; AcceptEmpty:Boolean=False): Boolean;

implementation

{$R *.DFM}

function InputDlg(ACaption, APrompt: string; var AValue: string; PasswordChar: Char=#0; AcceptEmpty:Boolean=False): Boolean;
begin
  Result := false;
  with TInputDlg.Create(Application) do
  begin
    if AcceptEmpty then
      Edit.OnChange := nil
    else
      OKBtn.Enabled := false;
    Caption := ACaption;
    Prompt.Caption := APrompt;
    Edit.Text := AValue;
    Edit.PasswordChar := PasswordChar;
    if ShowModal = mrOk then
    begin
      AValue := Edit.Text;
      Result := true
    end
  end;
end;

procedure TInputDlg.EditChange(Sender: TObject);
begin
  OkBtn.Enabled := Edit.Text <> '';
end;

end.

⌨️ 快捷键说明

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