2016-12-17 25 views

回答

4

要从VCL风格中获得视觉元素(字形),您必须使用GetElementDetailsTCustomStyleServices.DrawElement过程。

试试这个样本

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; 

enter image description here

+0

完美。我可以得到不受欢迎的图标,但不是主题图标。 – Mmarquee