inputunit.pas

来自「面对纵多的各种各样的资料」· PAS 代码 · 共 47 行

PAS
47
字号
unit InputUnit;

interface

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

type
  TInputFrm = class(TForm)
    Panel1: TPanel;
    Shape1: TShape;
    edt_InputText: TEdit;
    lbl_Caption: TLabel;
    Shape2: TShape;
    sbtn_OK: TSpeedButton;
    sbtn_Cancel: TSpeedButton;
    procedure sbtn_CancelClick(Sender: TObject);
    procedure sbtn_OKClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  InputFrm: TInputFrm;

implementation

{$R *.dfm}

procedure TInputFrm.sbtn_CancelClick(Sender: TObject);
begin
  ModalResult:=mrCancel;
end;

procedure TInputFrm.sbtn_OKClick(Sender: TObject);
begin
  if edt_InputText.Text<>'' then
    ModalResult:=mrOk
  else
    Exit;
end;

end.

⌨️ 快捷键说明

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