📄 roomset.pas
字号:
unit RoomSet;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, BaseUnit, StdCtrls, Buttons, IniFiles;
type
TFrmCode = class(TForm1)
Label1: TLabel;
EdtID: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure EdtIDKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmCode: TFrmCode;
implementation
{$R *.dfm}
procedure TFrmCode.BitBtn1Click(Sender: TObject);
var IniFile:TIniFile;
begin
inherited;
IniFile:=TIniFile.Create(ExtractFilePath(paramstr(0))+'Room.ini');
try
with IniFile do
begin
WriteString('Room','Room',EdtID.Text);
end;
finally
IniFile.Free;
end;
end;
procedure TFrmCode.FormShow(Sender: TObject);
var IniFile:TIniFile;
begin
inherited;
IniFile:=TIniFile.Create(ExtractFilePath(paramstr(0))+'Room.ini');
try
with IniFile do
begin
EdtID.Text:=ReadString('Room','Room','301002');
end;
finally
IniFile.Free;
end;
end;
procedure TFrmCode.BitBtn2Click(Sender: TObject);
begin
inherited;
close;
end;
procedure TFrmCode.EdtIDKeyPress(Sender: TObject; var Key: Char);
begin
inherited;
if not ( key in ['0'..'9',#23,#8]) then
key:=#0;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -