Page 1 of 1

ViewXY scrollbar range questions

Posted: Fri Aug 08, 2014 7:55 pm
by greggorob64
I have a bunch of SampleLineSeries, and I want to add a scrollbar to my window.

So i add it alright, and am trying to update the scrollbar based on where my window is.

So, in my Range Changed event, I do the following:

scroll.Minimum = 0;
scroll.Maximum = 16000; <-- sample maximum. I do have a delta that is very small, .00125 or something
scroll.Value = (range.max-range.min)/.00125 <-- lets say 8000 in this example

Here's my question: How do i tell how wide the scrollbar is? I'm referring to the actual rectangle you click with your mouse to drag.

For me, its very small when im zoomed out. I don't know how to tell it "you're using 50% of your range, so make the button very large).
Thanks!
Image

Re: ViewXY scrollbar range questions

Posted: Sat Aug 09, 2014 8:44 am
by ArctionPasi
It seems you have not set LargeChange property, which tells the 'page' length.

Please take a look at Winforms demo app's Simple tutorials / Scrollbar example. There's a problem some LC versions that may prevent scrollbar from appearing in because of automatic margins setting. If you don't see scrollbar there, set ViewXY.AxisLayout.AutoAdjustMargins = false.
Scrollbar example
Scrollbar example
scrollbar_example.jpg (345.05 KiB) Viewed 7992 times
Investigate this example's code on how to set the LargeChange.

Re: ViewXY scrollbar range questions

Posted: Mon Aug 11, 2014 12:39 pm
by greggorob64
Thanks. I didn't think that the scrollbar width could be affected by large/small change. I'll use the sample app you keep suggesting!

:D