Solved

Color of a slider control

Posted on 2000-04-11
3
915 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:VinExpert
ID: 2705463
Hi,

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

VinExpert
0
 
LVL 4

Accepted Solution

by:
inpras earned 50 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 108
Doc'in system (example?) BA 7 115
NotAlone Challenge 20 84
scoreUp challenge 14 63
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

839 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