Groups | Blog | Home
all groups > visual c > october 2007 >

visual c : ScrollBar colors


Peter Oliphant
10/27/2007 11:25:02 PM
Although the ScrollBar class has BackColor and ForeColor properties, these
properties don't seem to have any effect.

Is this correct? If so, is it possible to change the color of a ScrollBar?

[==Peter==]
Peter Oliphant
10/30/2007 8:53:07 AM
OK, since this is the only un-responded to topic in days, I'm going to guess
one CAN'T change the spots of this leooard... :)

[==Peter==]

[quoted text, click to view]

Frank Hickman
10/30/2007 1:29:32 PM
[quoted text, click to view]


Probably no response because if you went to CodeGuru.com or CodeProject.com
you would most likely find a sample that would show you how to do it. If
you cannot find one at one of those websites, I would suggest deriving a
class from the scrollbar and subclassing it into the window you want to set
the color in.

--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.

Peter Oliphant
10/31/2007 8:16:09 AM
Thanks, Frank,

Previously I had never heard of either CodeGuru.com or CodeProject.com. And
so of course I didn't realize everyone was suppose to know about them. I
guess everyone has to hear about them for the first time from somewhere. I
come here to learn such things. I'll check them out.

But I'm not sure how deriving a sub-class on a ScrollBar will allow me to
change the ScrollBar color if the ScrollBar class doesn't permit it without
such sub-classing.

[==Peter==]

[quoted text, click to view]

Peter Oliphant
10/31/2007 8:36:52 AM
OK, checked out CodeGuru.com. Did a search for 'scrollbar color'. Got back a
bunch of links. All the links I went to (abot 10 of them) were to posts by
people who asked the same question of how to change the scrollbar colors,
with nobody getting an answer, and most didn't even get response. And these
date back to over 6 YEARS ago.

Went to CodeProject. com. Here I found the same, plus a description on
sub-classing. It would easier for me to create my own scrollbar class FROM
SCRATCH than to do it by sub-classing. And at least I'd be in full control.
A ScrollBar is not that hard to write from scratch. I just didn't want to
re-invent the wheel if MS already provided one. But apparently I have to
write my own if I want to change the color of the 'wheel' in the case of
ScrollBars..

This seams very odd. Even though the ScrollBar class has BackColor and
ForeColor properties, for some reason we cant't use them. Why oh why is this
such a big deal? They must be using images and not colors, but then why do
BackColor and ForeColor exist AT ALL? It seems like 'less-than-opitmal'
design in this case (which is kind of rare for such Controls).

Oh well. Looks like one CAN'T change the colors of the ScrollBar. At least
nobody seems to know how...

[==Peter==]

[quoted text, click to view]

AddThis Social Bookmark Button