Main.pas
上传用户:llfxmlw
上传日期:2009-09-14
资源大小:335k
文件大小:1k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit Main;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   Menus, StdCtrls, FormSettings;
  6. type
  7.   TMainForm = class(TForm)
  8.     ServerBut: TButton;
  9.     ClientBut: TButton;
  10.     FormSettings1: TFormSettings;
  11.     procedure Exit1Click(Sender: TObject);
  12.     procedure ServerButClick(Sender: TObject);
  13.     procedure ClientButClick(Sender: TObject);
  14.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  15.   protected
  16.   public
  17.   end;
  18. var
  19.   MainForm: TMainForm;
  20. implementation
  21. uses ServerDlg, ClientFrm;
  22. {$R *.DFM}
  23. procedure TMainForm.Exit1Click(Sender: TObject);
  24. begin
  25.    Close;
  26. end;
  27. procedure TMainForm.ServerButClick(Sender: TObject);
  28. begin
  29.    // Hide;
  30.    ServerForm.Show;
  31. end;
  32. procedure TMainForm.ClientButClick(Sender: TObject);
  33. begin
  34.    // Hide;
  35.    ClientForm.Show;
  36. end;
  37. procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
  38. begin
  39.    FormSettings1.SaveSettings;
  40. end;
  41. end.