Solved

Color of a slider control

Posted on 2000-04-11
3
924 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Process filename extension 3 218
iSeries DB2 Query 2 101
Doc'in system (example?) BA 7 127
building a service to accessed via telnet client, want colors ? 4 109
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

752 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