Problem in placing vertical scrollbar on right or left side

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38004
    Saeidd2016
    Participant

    Hello,

    I use the following code to place the vertical scrollbar of components (such as VirtualTreeView, ListBox, DBGrid, etc) on right side in the RightToLeft bidimode and place it on left side in the LeftToRight bidimode.

    The code works perfectly when sSkinManager doesn't active. But when I active the SkinManager the code doesn't work. Is there a way to solve this problem?

    Code:
    procedure TForm1.Button2Click(Sender: TObject);
    const
    LSB = WS_EX_LEFTSCROLLBAR;
    var
    ExStyle: LONG_PTR;
    begin
    ExStyle := GetWindowLongPtr(AVTV.Handle, GWL_EXSTYLE);

    // Check if RTL alignment specified for you component
    if AVTV.BiDiMode = bdRightToLeft then
    begin
    // If so, then exclude LSB-constant and allow Windows place
    // scrollbar on the right side of window
    if (ExStyle and LS:cool: = LSB then
    SetWindowLongPtr(AVTV.Handle, GWL_EXSTYLE, ExStyle and not LS:cool:;
    end
    else
    if AVTV.BiDiMode = bdLeftToRight then
    begin
    // The same as operation above but for LTR order
    if (ExStyle and LS:cool: <> LSB then
    SetWindowLongPtr(AVTV.Handle, GWL_EXSTYLE, ExStyle or LS:cool:;
    end;
    end;

    AVTV is TVirtualStringTree component.

    #58565
    Support
    Keymaster

    Hello

    I will try to fix it in the nearest release.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.