📄 unboundmodedemocustomfield.pas
字号:
unit UnboundModeDemoCustomField;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, cxButtons, cxLookAndFeelPainters;
type
TUnboundModeDemoCustomFieldForm = class(TForm)
lbHeight: TLabel;
lbWidth: TLabel;
lbMineCount: TLabel;
edtHeight: TEdit;
edtWidth: TEdit;
edtMineCount: TEdit;
btnOK: TcxButton;
bntCancel: TcxButton;
procedure edtKeyPress(Sender: TObject; var Key: Char);
procedure bntCancelClick(Sender: TObject);
public
function ShowModal: Integer; override;
end;
implementation
uses UnboundModeDemoTypes;
{$R *.DFM}
function TUnboundModeDemoCustomFieldForm.ShowModal: Integer;
begin
SetFormPosition(Self, 25, 25);
Result := inherited ShowModal;
end;
procedure TUnboundModeDemoCustomFieldForm.edtKeyPress(Sender: TObject;
var Key: Char);
begin
if (Key < '0') or ('9' < Key) then
Key := Char(7);
end;
procedure TUnboundModeDemoCustomFieldForm.bntCancelClick(Sender: TObject);
begin
Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -