📄 fontlistfrm.pas
字号:
unit FontListFrm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, Spin;
type
TFontListForm = class(TForm)
FontListBox: TListBox;
SizeSpinEdit: TSpinEdit;
BitBtn1: TBitBtn;
FontStaticText: TStaticText;
procedure FormCreate(Sender: TObject);
procedure FontListBoxDblClick(Sender: TObject);
procedure SizeSpinEditChange(Sender: TObject);
procedure FontListBoxKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FontListForm: TFontListForm;
implementation
{$R *.dfm}
procedure TFontListForm.FormCreate(Sender: TObject);
begin
FontListBox.Items:=Screen.Fonts;
end;
procedure TFontListForm.FontListBoxDblClick(Sender: TObject);
begin
with FontListBox do
begin
If ItemIndex>=0 then
FontStaticText.Font.Name:=Items.Strings[ItemIndex];
end;
end;
procedure TFontListForm.SizeSpinEditChange(Sender: TObject);
begin
FontStaticText.Font.Size:=SizeSpinEdit.Value;
end;
procedure TFontListForm.FontListBoxKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key in [VK_RETURN, VK_SPACE, VK_F9] then
FontListBoxDblClick(FontListBox);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -