dialogfrm1.pas

来自「delphi 编制的服务器程序」· PAS 代码 · 共 74 行

PAS
74
字号
unit DialogFrm1;

interface

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

type
  TDialogForm = class(TChildForm)
    Panel1: TPanel;
    Label2: TLabel;
    Edit2: TEdit;
    Label3: TLabel;
    Edit3: TEdit;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Image1: TImage;
    SpeedButton1: TSpeedButton;
    procedure SpeedButton1Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  DialogForm: TDialogForm;
  function CallDialogForm(var Profess,People:string):Boolean;

implementation

uses ClassSelectFrm, PublicFunc;

{$R *.dfm}
  function CallDialogForm(var Profess,People:string):Boolean;
begin
  Result := True;
  if DialogForm = nil then
    DialogForm := TDialogForm.Create(Application);
  DialogForm.ShowModal;
  if DialogForm.ModalResult = MrOk then
  begin
    profess := DialogForm.Edit2.Text;
    people := DialogForm.Edit3.Text;
  end
  else
    Result := False;
  DialogForm.Free;
  DialogForm := nil;
end;
procedure TDialogForm.SpeedButton1Click(Sender: TObject);
var
  bh,mc: string;
begin
  inherited;
  if GetBMBHShare(bh,mc) then
    Edit2.Text := MC + '                            |'+bh;
end;

procedure TDialogForm.BitBtn1Click(Sender: TObject);
begin
  inherited;
  if (Edit2.Text = '') or (Edit3.Text = '') then
  begin
    MessageBoxInfo('请同时指定班级和该班级现有人数!');
    Exit;
  end;
  ModalResult := MrOk;
end;

end.

⌨️ 快捷键说明

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