How to create a FlatScrollBar

1.7k views Asked by At

Microsoft VB6 (Visual Basic 6) had a FlatScrollBar Control. I was terribly devastated not to find any such implementation in C#.

enter image description here

I humbly ask to my 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.

2

There are 2 answers

0
Hans Passant On BEST ANSWER

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.

0
Koen On

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.