Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Color of a slider control

Posted on 2000-04-11
3
Medium Priority
?
942 Views
Last Modified: 2013-11-20
How do you change the background color of a slider control?  Is this possible?

Thanks.
0
Comment
Question by:klingej
3 Comments
 
LVL 8

Expert Comment

by:Vinayak Kumbar
ID: 2705463
Hi,

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

VinExpert
0
 
LVL 4

Accepted Solution

by:
inpras earned 100 total points
ID: 2705769
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
 

Author Comment

by:klingej
ID: 2708633
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question