如何自定义HintFont.Size?
在 Windows 10 上的 Delphi 10.4.2 32 位 VCL 应用程序中,我试图自定义提示Font.Size:
type
TExHint = class(THintWindow)
constructor Create(AOwner: TComponent); override;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
constructor TExHint.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
with Canvas.Font do
begin
//Name := 'Verdana';
Size := 15;
//Style := [fsBold, fsItalic];
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
HintWindowClass := TExHint;
end;
但它不起作用。
如何自定义Font.Size应用程序的提示?
回答
这比这容易得多。
只需设置Screen.HintFont属性:
procedure TForm.FormCreate(Sender: TObject);
begin
Screen.HintFont.Size := 20;
end;
甚至
或者