issue text reverser (mirror)
Code:
procedure ChangeControlLayout(Control: TWinControl; ArabicLayout: Boolean); overload;
var
OldLong: LongWord;
begin
OldLong := GetWindowLong(Control.Handle, GWL_EXSTYLE);
if ArabicLayout then begin
Control.BiDiMode := bdLeftToRight;
SetWindowLong(Control.Handle, GWL_EXSTYLE, OldLong or WS_EX_LAYOUTRTL);
end
else
SetWindowLong(Control.Handle, GWL_EXSTYLE, OldLong and not WS_EX_LAYOUTRTL);
Control.Repaint;
end;
procedure ChangeControlLayout(ControlHandle: LongWord; ArabicLayout: Boolean); overload;
var
OldLong: LongWord;
begin
OldLong := GetWindowLong(ControlHandle, GWL_EXSTYLE);
if ArabicLayout then
SetWindowLong(ControlHandle, GWL_EXSTYLE, OldLong or WS_EX_LAYOUTRTL)
else
SetWindowLong(ControlHandle, GWL_EXSTYLE, OldLong and not WS_EX_LAYOUTRTL);
UpdateWindow(ControlHandle);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
//TreeView
ChangeControlLayout(tv1, True);
ChangeControlLayout(FindWindowEx(tv1.Handle, 0, nil, nil), True);
//ListView
ChangeControlLayout(lv1, True);
ChangeControlLayout(FindWindowEx(lv1.Handle, 0, nil, nil), True);
end;
-
This topic was modified 5 years, 1 month ago by Support.