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

📄 setparamfrm.pas

📁 一个delphi编写的收发短信源码, 使用了Cport控件,很实用
💻 PAS
字号:
unit SetParamFrm;

interface

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

type
  TfrmSetComm = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    CMPort: TComboBox;
    EdPhone: TEdit;
    SBOK: TSpeedButton;
    SBExit: TSpeedButton;
    procedure SBOKClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure SBExitClick(Sender: TObject);
  private
    { Private declarations }
    ClickOK: Boolean;
  public
    { Public declarations }
  end;

function Show_SetComm: Boolean;

var
  frmSetComm: TfrmSetComm;

implementation

{$R *.DFM}

function Show_SetComm: Boolean;
begin
  with TfrmSetComm.Create(nil) do
  begin
    ClickOK := False;
    try
      ShowModal;
    finally
      Result := ClickOK;
      Free;
    end;
  end;
end;

procedure TfrmSetComm.SBOKClick(Sender: TObject);
begin
  if (CMPort.ItemIndex = -1) or (EdPhone.Text = '') then
  begin
    Application.MessageBox('请把通信参数填写完整!', '系统提示', MB_OK + MB_ICONWARNING);
    Exit;
  end;
  with CommPort do
  begin
    Port := CMPort.Items.Strings[CMPort.ItemIndex];
    Phone := EdPhone.Text;
    Rate := '9600';
    SaveParam;
    ClickOK := True;
    Self.Close;
  end;
end;

procedure TfrmSetComm.FormCreate(Sender: TObject);
begin
  LoadParam;
  if CommPort.Port <> '' then
    CMPort.ItemIndex := CMPort.Items.IndexOf(CommPort.Port)
  else
    CMPort.ItemIndex := 0;
  EdPhone.Text := CommPort.Phone;
end;

procedure TfrmSetComm.SBExitClick(Sender: TObject);
begin
  Close;
end;

end.

⌨️ 快捷键说明

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