473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Managing to Customize Colors

I'm creating a managed VC++ .NET application that uses standard controls
(e.g., Form. RadioBox, Button, etc.). These use 'Color' as the type for such
things as ForeColor and BackColor. Many Colors are already provided (i.e.,
Black, Red, SeaGreen, etc.) as a convenience.

However, I can't seem to find out how to create my own custom colors. In the
VC++ GUI it seems to think I should be able to use the Color::Color(r,g,b)
constructor, in that it recognizes them in the editor (i.e., they show up as
'tool tips' when typing the Color constructors). But, when compiled, it says
these same constructors don't exist!

I want to do something like:

Color myColor( r, g, b ) ;

where 'r','g', and 'b' are the red green anf blue componenets of the color.
An alpha channel component ('a' in ARGB) would be nice, but not necessary.

Note that in theory the above should just work (assuming r,g, and b are
setup correctly), but it doesn't. I assume I can create my own colors, but
how?

PS - I have a similar problem with Fonts. How do I get a list of available
FontFamiy's for a particular machine so I can change a control's font to one
other than the default (and make sure it is available)?
Nov 17 '05 #1
1 1010
There must be some way to create one's own Color's (again, the
constructors don't compile, why?). Do I need some header file I'm unaware
of? Does it require some dependency?

This should be a simple question, but no responses in days. Please help!
: )
"Peteroid" <pe************@msn.com> wrote in message
news:#d**************@TK2MSFTNGP09.phx.gbl...
I'm creating a managed VC++ .NET application that uses standard controls
(e.g., Form. RadioBox, Button, etc.). These use 'Color' as the type for such things as ForeColor and BackColor. Many Colors are already provided (i.e., Black, Red, SeaGreen, etc.) as a convenience.

However, I can't seem to find out how to create my own custom colors. In the VC++ GUI it seems to think I should be able to use the Color::Color(r,g,b) constructor, in that it recognizes them in the editor (i.e., they show up as 'tool tips' when typing the Color constructors). But, when compiled, it says these same constructors don't exist!

I want to do something like:

Color myColor( r, g, b ) ;

where 'r','g', and 'b' are the red green anf blue componenets of the color. An alpha channel component ('a' in ARGB) would be nice, but not necessary.
Note that in theory the above should just work (assuming r,g, and b are
setup correctly), but it doesn't. I assume I can create my own colors, but how?

PS - I have a similar problem with Fonts. How do I get a list of available FontFamiy's for a particular machine so I can change a control's font to one other than the default (and make sure it is available)?

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: aznFETISH | last post by:
I have a list of links that I ue on my page, I alternate background colors for these links in a table, I usually do it using a DB but this list of link is manually added into the page so my...
3
by: Gabriele Farina | last post by:
Hi guys, can someone ask me how can I manage something like Windows-media-player skins engine using wxPython?? Do I have to build soething like a small gui engine using Canvas or there are...
7
by: Laszlo Zsolt Nagy | last post by:
Hello, How can I determine the number of colors used in an image? I tried to search on Google but I could figure out. I read the PIL handbook but I do not see how to do it. Can anyone help? ...
1
by: krian | last post by:
Hi, How can I change the styles of the DropDownList(Select box)..? and also I want to place an image in the place of DropDownButton of Select Box .. How can i done these in DHTML..?. I would...
1
by: Joe Abou Jaoude | last post by:
HI all, I' ve read that with IE 5.5 and later, scollbars' colors can be customized. I was wondering if we can also change scrollbars width, because they appear too large and ugly on small div...
6
by: Danny Lesandrini | last post by:
I'm using an Access database to drive a web site and the colors of various table backgrounds are stored in Access. I want users of the Access database to be able to select colors for the site, but...
11
by: Paul Smith | last post by:
I have a button on my web page the backcolor of which I want to change: btnSample.backcolor = ???????? I want the color to be Gainsboro However I enter Gainsboro or color.Gainsboro I have...
1
by: Demi | last post by:
I want to be able to define standard colors in a base form, then have child forms use those values instead of standard colors. Ex in my base form I want to do this: Color myColor =...
0
by: Sky | last post by:
I have an Access 2003 front-end database with custom toolbars. The toolbars work fine. One annoying feature is that at the far right edge of each custom toolbar there a small dropdown arrow....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.