comselect.pas
来自「请使用Mobile FBUS——用来创建与NOKIA手机连接的软件的理想解决方案」· PAS 代码 · 共 61 行
PAS
61 行
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 + =
减小字号Ctrl + -
显示快捷键?