Show the window shadow when using VCL styles

独自空忆成欢 提交于 2019-12-12 15:45:41

问题


Is there a way to show the window shadow, as per normal Windows 7 forms, when using a VCL style?

I understand the bitmap and settings in the style replaces the form borders, but isn't the shadow some sort of alpha blend / aero thing that is outside the area affected by the style?

Adding CS_DROPSHADOW to the WindowClass.Style seems to have no effect.


回答1:


Using the CS_DROPSHADOW style works fine

type
  TMyForm = class(TForm)
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  end;

procedure TMyForm.CreateParams(var Params: TCreateParams);
begin
  inherited;
  with Params do
    WindowClass.Style := WindowClass.Style or CS_DROPSHADOW;
end;



来源:https://stackoverflow.com/questions/18324571/show-the-window-shadow-when-using-vcl-styles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!