C++ Colored Buttons in Visual Studio 2005

Here you can talk about C++ And C# And Other languages programming.

C++ Colored Buttons in Visual Studio 2005

Postby radarguy » Mon Apr 21, 2008 10:50 am


I'm a beginner with Visual Studio and I'm trying to make a class that would enable me to put Colored Buttons in MFC dialogs and apps (colored texts and backgrounds).

I googled up some ColorButton classes, but they are all pretty old and don't work with Visual Studio 2005..

Can anyone please help me with some code or useful links, especially with the DrawItem, get and set color functions?
radarguy
 
Posts: 2
Joined: Mon Apr 21, 2008 10:43 am

Re: C++ Colored Buttons in Visual Studio 2005

Postby autopilot » Mon Apr 21, 2008 11:22 am

are you just trying to change the background & text color of command buttons? if so, use somthing like:
Code: Select all
            //change background color
            button1.BackColor = Color.Firebrick;
            //change text color
            button1.ForeColor = Color.ForestGreen;
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 356
Joined: Sat Sep 23, 2006 7:19 pm

Re: C++ Colored Buttons in Visual Studio 2005

Postby radarguy » Mon Apr 21, 2008 11:59 am

autopilot wrote:are you just trying to change the background & text color of command buttons? if so, use somthing like:
Code: Select all
            //change background color
            button1.BackColor = Color.Firebrick;
            //change text color
            button1.ForeColor = Color.ForestGreen;


this would probably do for individual buttons, but i'm going for a class/control that can actually create the buttons by drawing them or construct them from the standard command buttons
radarguy
 
Posts: 2
Joined: Mon Apr 21, 2008 10:43 am

Re: C++ Colored Buttons in Visual Studio 2005

Postby Chike » Mon Apr 21, 2008 1:30 pm

My guess is you are looking for something like this.

radarguy wrote:I googled up some ColorButton classes, but they are all pretty old and don't work with Visual Studio 2005..

Well MFC is old, no many using it anymore. Doesn't matter how old they are, the principle is what importang, you can always change it as you see fit.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 581
Joined: Sun May 13, 2007 6:20 pm


Return to C++, C# And Others Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests