scrollbar position painting problem

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #33562
    mcarro
    Participant

    Hi, I have a TsScrollBox with many controls inside. When I move the scrollbox contents dragging the scrollbar thumbs everything (re)paints beautifully, but if I set the value of VertScrollbar.Position programmatically the controls move to the new position but the background does not seem to scroll (or in any case fails to repaint properly).

    I tried calling Invalidate and Repaint on the scrollbox after setting the Position property, but does not make any difference.

    Is there anything else I should be doing? I'm using v6.54.

    Thanks in advance for any hint…
    Mario

    #41712
    Support
    Keymaster

    Hello
    Can you show a demo with the problem?
    Thank you in advance.

    #41743
    mcarro
    Participant

    Hi, excuse me for the delay. I'm attaching an (ugly) small test app showing the problem.

    Scroll the using the mousewheel. Look at the bottom part of frame #1 when scrolling upwards and the upper part of frame #2 when scrolling down. You'll see that the background color in the frames is wrong. If you then drag a bit the scrollbar by its thumb everything repaints as it should.

    Thanks…
    Mario

    #41755
    Support
    Keymaster

    Hi
    Thank you for the demo, I understand a problem now. This issue can't be fixed quickly, some changes in the engine are needed. I think this problem will be solved but not in nearest releases.

    #41761
    mcarro
    Participant

    Ok, thanks for your answer. Any workaround meanwhile? Is there a way I can force the skin to repaint the background?

    #41762
    Support
    Keymaster

    Try this line after ScrollBar position changing :
    RedrawWindow(sScrollBox1.Handle, nil, 0, RDW_ALLCHILDREN or RDW_INVALIDATE);

    #41764
    mcarro
    Participant

    Is not as smooth scrolling dragging the thumb of the scrollbar, but it will do the trick until is fixed in the engine.
    Thanks!

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