Colored Scroll bars

  • Thread starter Thread starter Alexander Arlievsky
  • Start date Start date
A

Alexander Arlievsky

Hi,
We would like to change background color of all scroll bar components in our
..Net application, but change should apply to all controls in our
application. I mean not only ScrollBar controls explicitly used, but scroll
bars in tree, listview, combo and third-party controls etc. We even have MFC
control used through managed c++ wrapper with its own scroll bars.
Is there some way to do it (subclassing windows, application-wide hook, etc)
?
We can code it Win32 pure if it helps.

Alexander Arlievsky.
 
As another approach (not tried), maybe you could create the controls with
the "Custom Draw" style (e.g., LVS_CUSTOMDRAW for list controls) and
intercept the NM_CUSTOMDRAW notification at the CDDS_POSTPAINT stage. From
there, the control would have already painted its scroll bar, which you
could over-draw by plastering up your own bitmap of a scroll bar wherever
it's needed. See
http://msdn.microsoft.com/library/d...ellcc/platform/commctls/custdraw/custdraw.asp
 
This is what MSDN (Platform SDK\User Interface Services\Controls Scroll
Bars\...) says on the subject
WM_CTLCOLORSCROLLBAR
The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll
bar control when the control is about to be drawn. By responding to this
message, the parent window can use the display context handle to set the
background color of the scroll bar control.

<...>
 
Back
Top