开发者

Any easy way to use Custom ScrollBars on a .Net Control

I have a UserControl and I want to make custom scrolling. Can I use the already built in Horizontal and Vertical ScrollBars without setting the AutoScroll flag to true? I can Enable and define min and max value for both ScrollBars and I can see them on my control, but when clicking the buttons they don't move and in the scroll events I 开发者_高级运维don't get any useful value.

            HorizontalScroll.Value = 0;
            VerticalScroll.Value = 0;
            HorizontalScroll.Minimum = 0;
            HorizontalScroll.Maximum = 900;
            VerticalScroll.Minimum = 0;
            VerticalScroll.Maximum = 600;
            HorizontalScroll.Visible = true;
            VerticalScroll.Visible = true;
            HorizontalScroll.SmallChange = 2;
            HorizontalScroll.LargeChange = 4;
            HorizontalScroll.Enabled = true;
            VerticalScroll.Enabled = true;
            this.Scroll += new ScrollEventHandler(PanelsHolder_Scroll);

in the Scroll Event I can't get any changes. Any way to use the built-in without I have to add the scrolls controls manually?


Don't see why not to use AutoScroll.

if you use the controllers, you'll have to move the controls by your self.

use e.NewValue to determined the value of the scroll. (in the event)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜