隐藏提示中的DropShadow

时间:2016-02-26 04:32:11

标签: delphi delphi-10-seattle

在我的应用程序中,我想使用提示来显示其他信息。

看起来像这样:

enter image description here

我注意到Firefox显示没有阴影的提示:

enter image description here

我对谷歌的研究只让我对添加阴影(XP天)而不是删除它们提出了疑问。

所以我的问题是: 如何从提示中删除阴影?感谢。

1 个答案:

答案 0 :(得分:3)

您只需创建自己继承THintWindow的提示窗口类,在CreateParams中删除CS_DROPSHADOW,然后将vcl设置为使用您的类而不是默认值。

TMyHintWindow = class(THintWindow)
protected
  procedure CreateParams(var Params: TCreateParams); override;
end;

procedure TMyHintWindow.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  Params.WindowClass.Style := Params.WindowClass.style and not CS_DROPSHADOW;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  FOldHint := HintWindowClass;
  HintWindowClass := TMyHintWindow;
  // FOldHint is type of THintWindowClass;
  // If you like to reset hint window to its original value you just set it back to FOldHint
  // HintWindowClass := FOldHint;
end;
相关问题