Get A Canvas To Scroll Properly in Code

I have a Canvas that sits on a ContainerControl in a PagePanel. I am able to successfully add container controls to the Canvas and fill-up the visible part of the control. The purpose would be for the user to immediately starting putting information into the new ContainerControl. When I add one more, I am able to call Canvas.Scroll and give it the (-) height of the control. It successfully scrolls down one to display the new ContainerControl. (The current Canvas will hold 7, so the display shows 2-8 at this point.) I have 2 problems.

  • I do change the value of the scrollbar each time I add a control (maximum) and the size of the middle bar changes each time I do so… from filling almost the entire scrollbar to a smaller one at the top. However the scrollbar is still at the top even after I scroll, so I cannot click on it to get back to number 1. Is there a way to change the scrollbar when I scroll from the Canvas? I’m not finding a method for that.

  • After I scroll successfully the 1st time, then each of the next ContainerControl I put in, while it has the correct position in the Canvas, skips a space in the display. Don’t know why this is happening.

I would appreciate any insite into this. It would be nice to make the Canvas scroll each time a new one is added past the 1st 7.

Thanks,
Gary