470,641 Members | 1,450 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,641 developers. It's quick & easy.

Keeping up with a scrollable panel

Hi all,

In my project I have a control (described in an earlier post) which
basically consists of three "subcontrols": One big area where the vital
data is displayed (scrollable, since it will usually be larger than the
window containing the parent control), a time strip on top of it, and a
resource list on the left. Long story short - when someone scrolls the
scrollable data control, the time strip and resource lists are hooked to
keep up and update themselves.

I used to have the time strip and resource list as scrollable controls
as well, and then just scroll their position along when the main data
control was scrolled. The downside to this - while resizing, the
scrollbars would flash on and off constantly, even if I did a
SuspendLayout() / ResumeLayout() around the resize process.

So I decided to try out another way; The time strip is very simple
(basically just a few lines on the hour, half hour and 15/45 minute
marks, plus a text indicating the time on the hour marks) so I thought
it should be able to keep up - when the main control is scrolled, the
time strip is told what time it is scrolled to, then the control
repaints itself. This works;

However, if I scroll horizontally faster than.. well, painfully slow,
the time strip takes a break, and does not update until I slow down or
stop. The repainting of the main data control is a LOT more complex than
the time strip, so I would actually not think that there would be a
problem keeping up. However, as it is now, the approach with scrolling
another scrollable control in sync with the main one was a lot smoother.

I set all controls to be DoubleBuffer|UserPaint|AllPaintingInWmPaint, btw.

What can I do to ensure that the time strip keeps up? Should I somehow
detect that a new scroll position has been sent inside my paint routine,
so that it aborts the current paint and starts a new one?

Any insights on this would be highly appreciated!


Apr 4 '07 #1
0 1316

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by flamesrock | last post: by
reply views Thread by Suresh Kojhani | last post: by
reply views Thread by Geoff B via .NET 247 | last post: by
reply views Thread by objectref | last post: by
2 posts views Thread by UJ | last post: by
3 posts views Thread by Les | last post: by
3 posts views Thread by Nathan Sokalski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.