cannot change backcolor of scrollbar in Winforms app
according to MS there must be property scrollbar.backcolor but cannot find it.
Any ideas ??
cannot change backcolor of scrollbar in Winforms app
according to MS there must be property scrollbar.backcolor but cannot find it.
Any ideas ??
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tahir AnsariPosted Oct 27, 2023, 5:27 AM
In Windows Forms (WinForms) applications, the
ScrollBarcontrol does not have aBackColorproperty by default. This means that you cannot directly change the background color of aScrollBarby setting itsBackColorproperty.you can work around this limitation by creating a custom
ScrollBarcontrol by inheriting from the existingScrollBarcontrol and overriding theOnPaintmethod to draw your custom background color.we create a custom
ScrollBarcontrol namedCustomScrollBarand set itsBackColorproperty to the desired background color. We then override theOnPaintmethod to draw the background color as a rectangle. You can replaceColor.Bluewith your preferred background color.boris salnikovPosted Oct 27, 2023, 12:54 PM
Thanks