Solved

Color of a slider control

Posted on 2000-04-11
3
898 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now