首页 > 代码库 > delphi 修改Hint的字体和颜色

delphi 修改Hint的字体和颜色

//修改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;


//完成 -> 修改任意组件提示文本的样式


来自为知笔记(Wiz)