从提示中隐藏 DropShadow
Hide DropShadow from Hints
在我的应用程序中,我想使用提示来显示附加信息。
看起来像这样:
我注意到 Firefox 显示的提示没有阴影:
我对 google 的研究只让我想到了有关添加投影(XP 天)而不是删除它们的问题。
所以我的问题是:
我怎样才能从提示中删除阴影?谢谢
您只需创建自己的提示 window class 继承自 THintWindow,删除 CreateParams 中的 CS_DROPSHADOW,然后将 vcl 设置为使用您的 class 而不是默认设置。
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;
在我的应用程序中,我想使用提示来显示附加信息。
看起来像这样:
我注意到 Firefox 显示的提示没有阴影:
我对 google 的研究只让我想到了有关添加投影(XP 天)而不是删除它们的问题。
所以我的问题是: 我怎样才能从提示中删除阴影?谢谢
您只需创建自己的提示 window class 继承自 THintWindow,删除 CreateParams 中的 CS_DROPSHADOW,然后将 vcl 设置为使用您的 class 而不是默认设置。
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;