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

📄 connectdlg.pas

📁 能够监视另一台机子的屏幕
💻 PAS
字号:
unit ConnectDlg;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  FormSettings, StdCtrls, Buttons, Registry;

type
  TClientConnectForm = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    PortEdit: TEdit;
    ConnectBut: TBitBtn;
    CancelBut: TBitBtn;
    FormSettings1: TFormSettings;
    ServerCombo: TComboBox;
    Label3: TLabel;
    PassEdit: TEdit;
    StartScreenBox: TCheckBox;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
    procedure  LoadCombo;
    procedure  SaveCombo;
  public
    { Public declarations }
  end;

var
  ClientConnectForm: TClientConnectForm;

implementation

{$R *.DFM}

procedure TClientConnectForm.FormClose(Sender: TObject;
  var Action: TCloseAction);
var
   s : string;
   i : integer;
begin
   s := ServerCombo.Text;
   i := ServerCombo.Items.IndexOf(s);
   if i <> -1 then ServerCombo.Items.Delete(i);
   ServerCombo.Items.Insert(0, s);

   while ServerCombo.Items.Count > 8 do
      ServerCombo.Items.Delete(8);

   ServerCombo.Text := s;

   SaveCombo;
   FormSettings1.SaveSettings;
end;

procedure TClientConnectForm.FormShow(Sender: TObject);
begin
   LoadCombo;

   ServerCombo.SetFocus;
end;

procedure TClientConnectForm.LoadCombo;
var
   ini : TRegIniFile;
begin
   ini := TRegIniFile.Create('Software\' + Application.Title);

   ServerCombo.Items.CommaText := ini.ReadString('Servers', 'ServerCombo', '');
   ServerCombo.ItemIndex := 0;

   ini.Free;
end;

procedure TClientConnectForm.SaveCombo;
var
   ini : TRegIniFile;
begin
   ini := TRegIniFile.Create('Software\' + Application.Title);

   ini.WriteString('Servers', 'ServerCombo', ServerCombo.Items.CommaText);

   ini.Free;
end;


end.

⌨️ 快捷键说明

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