tags:

views:

579

answers:

4

How do I change the color of a scrollbar in Delphi?

+2  A: 

make your life easy and just download a componet. ie: http://www.torry.net/pages.php?id=160

because as far as I know you can only change the background of the scrollbar as in

ScrollBar1.Color := clRed;
Benjamin Neil
+2  A: 

You cant do this easily, you will have to implement your own scroll bar replacement (or use one that someone else has already done). A good article that walks you through this process (although not for Delphi sadly) is available.

skamradt
+2  A: 

I haven't tried it, but this post suggests that you can override WndProc and handle WM_CTLCOLORSCROLLBAR messages.

Bruce McGee
+1  A: 

By asking the user to use Display|Properties|Appearance and selecting the color they want for various Windows elements.

System colors are a user configuration item, and shouldn't be changed in your application without a very good reason. It is the user's machine, after all, and the user is the one who cares what color scrollbars are; your application shouldn't.

Ken White
-1. This doesn't really answer the question. You said he'd need a good reason to change the color, so, since he's asking, give him the benefit of the doubt and suppose he has such a reason. He doesn't have to explain himself to you. If you just want to preach, please post a comment, not an answer.
Rob Kennedy
Feeling a little pissy today, Rob? I didn't "preach", and I don't recall being informed anywhere that you were the one in charge of deciding whether an answer qualified as such or not. You voted my answer down, and that's fine. Passing judgment on me personally is not.
Ken White