//修改Hint的字体和颜色
public
{ Public declarations }
procedure Sshowhint(var hintstr:string;var canshow:Boolean;var HintInfo:THintInfo);
procedure TForm1.FormCreate(Sender: TObject);
begin
form1.Hint:= ‘改变提示栏‘;
form1.ShowHint:=true;
Application.OnShowHint:= Sshowhint;
end;
procedure TForm1.Sshowhint(var hintstr:string; var canshow: Boolean;
var HintInfo: THintInfo);
var
i:integer;
begin
for i:=0 to Application.ComponentCount-1 do
if Application.Components[i] is THintWindow then
with THintWindow(Application.Components[i]).Canvas do
begin
Font.Name := ‘隶书‘;
Font.Size := 18;
HintInfo.HintColor := clskyblue;
end;
end;
//完成 -> 修改任意组件提示文本的样式
delphi 修改Hint的字体和颜色
时间: 2024-11-15 15:32:35