Change amount scrollbar moves on a panel

I have a panel with many child controls and with Autoscroll enabled. Clicking the arrow at the top or bottom of the scrollbar results in a tiny movement of a few pixels only:

单击向下箭头的面板

Can the amount of movement be controlled and set to a much larger value? Using the .NET Compact Framework.

EDIT 1

In the full version of .NET, the VerticalScroll.SmallChange and VerticalScroll.LargeChange properties can be accessed directly. But these are not available in the Compact Framework. So the question is how to do this in the Compact Framework?

EDIT 2 By viewing the panel's AutoScrollPosition.Y , I've discovered that the SmallChange parameter is set to 5 pixels. This must be the default for Panel controls in the Compact Framework. For my touchscreen application, this needs to be something like 70 pixels.


After much research I've come to the conclusion that this is simply not possible in the Compact Framework. This answer is not for the specific question but an excellent workaround adapted from this answer by Cyril Gupta

  • Create a new "parent" panel and place the old panel on this parent
  • Resize the child so that a small area of the parent is visible. Place Up and Down buttons on this area.
  • Disable AutoScroll on the child panel.
  • Set the height of the child panel so that the scrollbar disappears. Note that not all of the controls will be visible, of course.
  • When one of the buttons is clicked on the parent panel, change the Top property of the child.
  • Works nicely!

    链接地址: http://www.djcxy.com/p/53704.html

    上一篇: 推迟执行和急切评估

    下一篇: 更改数量滚动条在面板上移动