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

📄 comselect.pas

📁 请使用Mobile FBUS——用来创建与NOKIA手机连接的软件的理想解决方案!功能包括:发送SMS
💻 PAS
字号:
unit ComSelect;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,INIFIles;

type
  TfmSelectComPort = class(TForm)
    grpComSelect: TGroupBox;
    cmboComport: TComboBox;
    btnOK: TButton;
    procedure btnOKClick(Sender: TObject);
    Procedure Change;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmSelectComPort: TfmSelectComPort;

implementation

{$R *.DFM}

procedure TfmSelectComPort.btnOKClick(Sender: TObject);
var
  fIniFile :TIniFile;
  iPort:integer;
begin

  if cmboComport.ItemIndex>-1 then
    begin
      iPort:=cmboComport.ItemIndex;
      fIniFile :=TIniFile.create(extractFilePath(GetCurrentDir+'\')+'fbus.ini');
      fINIFile.writeInteger('COMPORT','PORT',iPort);
      fINIFile.free;
      self.Close;
    end
  else
    MessageDlg('Please Select a Comport',mtWarning,[mbOk],0);

end;

Procedure TfmSelectComPort.Change;
var
  fIniFile :TIniFile;
  iPort:integer;
begin
  iPort:=cmboComport.ItemIndex;
  fIniFile :=TIniFile.create(extractFilePath(GetCurrentDir+'\')+'fbus.ini');
  iPort:=fINIFile.ReadInteger('COMPORT','PORT',iPort);
  fINIFile.free;
  cmboComport.ItemIndex:=iPort;
  Showmodal;
end;
end.

⌨️ 快捷键说明

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