开发者

VB2010 Invert Scroll Bar Value

I am trying to have a vertical scroll bar on a form. I would like th开发者_如何学Ce value of the scroll bar to be, from top to bottom, 35 to -35.

I tried to set the minimum value to 35 and max to -35, but vb wont allow it.

Is there a way to do this without catching the value when it's changed and storing the inverted value in a variable?


No, you can't do that. You will have to convert it yourself. Though you can make coding easier by having a property that calculates it automatically:

public int SliderValueTransformed
{
    get
    {
        return -this.Slider.Value;
    }
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜