如果使用VCL样式Utils组件,则在Vcl.Styles.UxTheme.pas中修改UxTheme_TreeView
case iPartId of
TVP_GLYPH:
begin
LColor := StyleServices.GetSystemColor(clWindowText);
LRect := pRect;
LRect.Top := LRect.Top + 1; // <---- here's the change
//LRect.Top := LRect.Top + 5;
LRect.Left := LRect.Left + 5;
if (iStateId = GLPS_OPENED) or (iStateId = HGLPS_OPENED) then
DrawStyleArrow(hdc, TScrollDirection.sdDown, LRect.Location, 3, LColor)
else
DrawStyleArrow(hdc, TScrollDirection.sdRight, LRect.Location, 3, LColor);
exit(S_OK);
end;
也设置树视图属性ShowLines := false;