• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 949
  • Last Modified:

Color of a slider control

How do you change the background color of a slider control?  Is this possible?

Thanks.
0
klingej
Asked:
klingej
1 Solution
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

I dont think it is possible :(
May be, try with owner drawn!!!

VinExpert
0
 
inprasCommented:
Hi
derive UR own class from CSliderControl say CMySlider
make UR slider control variable as CMySlider
map       ON_WM_CTLCOLOR_REFLECT() ie =WM_CTLCOLOR and in the function return the desired color brush
HBRUSH CMySlider::CtlColor(CDC* pDC, UINT nCtlColor)
{
      
      HBRUSH hbr;
      pDC->SelectStockObject(WHITE_BRUSH);
      hbr = (HBRUSH)::GetStockObject(WHITE_BRUSH);
      return hbr;
}
Hope this helps
inpras
0
 
klingejAuthor Commented:
I actually didn't need to derive my own class..  I just used OnCtlColor for my form and returned different brushes for the control drawing.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now