Get a specific glyph from Delphi VCL Style

独自空忆成欢 提交于 2019-12-06 07:58:21

To get a Visual element (glyph) from a VCL Style you must use the GetElementDetails and the TCustomStyleServices.DrawElement procedure.

Try this sample

uses
  Vcl.Themes;

{$R *.dfm}

procedure TForm1.PaintBox1Paint(Sender: TObject);
var
  LDetails : TThemedElementDetails;
begin
  //Get the detailsfor the HelpButton
  LDetails := StyleServices.GetElementDetails(twHelpButtonNormal);
  //Draw the the element in the canvas.
  StyleServices.DrawElement(TPaintBox(Sender).Canvas.Handle, LDetails, TPaintBox(Sender).ClientRect);
end;

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