开发者

VB.NET: Scrollbar "button"?

I plan on using a scrollbar for, well, scrolling an image. The image is 200x500, however, the only visible area is 200x250.

So I set the max value to 250, and the min value to 0. The idea is that if I drag the scrollbar's button to the bottom, 250 pixels will have moved for the image, right?

But wait, the scrollbar's button is.... very small. And the scrollbar is actually pretty long. Is there a way to make the scrollbar's开发者_运维技巧 button longer?


How did you create this scrollbar? Is it a separate control all together, or it is a component of another control? I do know that scrollbars added separately act kinda funny at times.

What I would suggest is using the scollbars built into another container control, which should achieve the exact same effect.

  1. Create a new panel control on your form, and name it. (I suggest something like panelPicture)
  2. Position the panel where you want your picture to be.
  3. Set the panel's size to 200x250.
  4. Set the panel's "Autoscroll" property to True.
  5. Put a PictureBox inside this panel, and name it. (I suggest something like picMyPicture.)
  6. Set the PictureBox's position to 0, 0.
  7. Set the PictureBox's size to 200x500 (or whatever is necessary).
  8. Set the PictureBox's Image property as desired.

Now, the scrollbar should automatically appear on the picture, and it should look normal.

As a side note (which may or may not be relevant), users typically don't like having to scroll to see the rest of an image, so if you don't need the user to scroll down on the image for some definitive purpose (or because you don't know what the size of the image that will be handled is), I'd try and change the size of things on your form so scrolling will not be necessary.

I hope this helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜