How to create a FlatScrollBar
Microsoft VB6 (Visual Basic 6) had a FlatScrollBar Control. I was terribly devastated not to find any such implementation in C#.
I humbly ask to my开发者_Python百科 fellow C# developers and Windows Forms gurus if this feat is achievable in C# or not ? I thank any reply or insight into this matter in advance.
Support for flat scrollbars has been removed from the Windows common controls version 6. It is only available in the legacy version. Which means you cannot have visual styles at the same time as flat scrollbars. Google InitializeFlatSB, you might find somebody that thought the flat bars were more important. I rather doubt it.
Well, I hardly call myself a guru (far from it ;-) ) but in the Toolbox there's a HScrollBar (horizontal) and a VScrollBar (vertical), which might suit your needs.
There's also the possibility to use the AutoScroll property on a control (or form). As I understand that correctly (haven't used it yet) it decides for you if the scrollbars are needed or not, depending whether there are controls outside the visual.
However, if this is not what you're looking for, there's a possibility to use custom-made scrollbars. There are a lot of articles about it on CodeProject.
Hope this puts you in the right direction.
精彩评论