TreeView's ScrollBar Not Accept VCL theme when mirroring
Asked Answered
M

1

5

TTreeView's ScrollBar does not accept VCL themes when mirroring the Treeview by this code:

procedure SetWinControlBiDi(Control: TWinControl);
const
 WS_EX_NOINHERITLAYOUT = $00100000;
 WS_EX_LAYOUTRTL = $00400000;
var
 ExStyle: Longint;
begin
 ExStyle := GetWindowLong(Control.Handle, GWL_EXSTYLE);
 SetWindowLong(Control.Handle, GWL_EXSTYLE, ExStyle or WS_EX_RTLREADING or WS_EX_RIGHT
   or WS_EX_LAYOUTRTL or WS_EX_NOINHERITLAYOUT );
end;


procedure TForm2.FormCreate(Sender: TObject);
begin
   SetWinControlBiDi(TreeView1);
end;

Sample image:

enter image description here

what should I do?

pls help me...

Myke answered 1/9, 2015 at 13:52 Comment(3)
Don't know what is exactly wrong but it works when you include @RRUZ's excellent Vcl.Styles.Hooks unitWindtight
Additional note, if you set BiDiMode := bdRightToLeft; on the form then the scrollbar is rendered correctly but the treeview RTL mode is not rendered correctly...Windtight
Thanks... @WindtightMyke
G
7

This is an issue in the TScrollingStyleHook style hook, you should report this to Embarcadero. Meanwhile you can use the Vcl Styles Utils project to fix this.

Only you need follow the installation instructions and then add the Vcl.Styles.Hooks unit to your project.

enter image description here

Gareri answered 1/9, 2015 at 14:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.