Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2004

Tip: Looking for answers? Try searching our database.

Managing to Customize Colors

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peteroid - 19 May 2004 21:07 GMT
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)?
Peteroid - 22 May 2004 05:04 GMT
 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!
: )

 > 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)?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.