darkScrollBar Properties
ohhsodead opened this issue · comments
Woops, I never meant to submit this early.
Basically, how should I go about setting the scrollBar control properties to match those with, e.g. my flowLayoutPanel, so I can imitate its status. I currently have set the Minimum, Maximum and Value properties of the default winform scrollBar, but aren't able to figure out to get the ViewSize. Also, I'm assuming that the ValueChanged event should set the default scrollBar Value property, which works fine, I just cannot get scroll any further than a certain portion of the flowLayoutPanel area.
Thanks.
The ViewSize
property should match the viewable area of the control. This value is used in the scrollbar's internal calculations for sizing the area of the 'thumb' - the centre piece which gets dragged around as you scroll. It is also used for calculating the absolute position when using methods such as ScrollToPhysical()
You can see how the scrollbars are setup and managed in the DarkScrollBase
control. This is what I use as the base class for any DarkUI control which needs to scroll.
DarkUI/DarkUI/Controls/DarkScrollBase.cs
Lines 166 to 177 in 31603ae
DarkUI/DarkUI/Controls/DarkScrollBase.cs
Lines 154 to 155 in 31603ae
I've never personally tried to marry a DarkScrollBar
with a stand-alone control such as a FlowLayoutPanel
so I'm not sure if there are any subtleties or quirks. In theory you should be able to set the ViewSize
to the Width
and Height
of the panel and it should work.
If not, let me know and I'll take a closer look.
Thank you very much for the fast response! All has been completed. With your project I'm finally able to design beautiful applications, so I really appreciate your work! Amazing stuff.
I'm glad it's getting some use! Good luck in your project.
So I'd like to add the DarkScrollBar to the DarkPanel or DarkSectionPanel control. Do I have to copy basically the whole DarkScrollBase
to make this work?
How did you do this @ohhsodead?