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 / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Pastel Colors?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy - 10 Oct 2007 23:03 GMT
Hi,
I'm trying to set the background color of a datagrid cell into a pastel color.

I can change this into other colors in the grid_ItemDataBound event thus:
e.Item.Cells(3).BackColor = System.Drawing.Color.Green
or
e.Item.Cells(3).BackColor = System.Drawing.Color.Red
(dependent on particular values in some of the columns) but these seem
pretty garish to me.

How can I set these to non-standard colors - in a variety of pastel shades?
Hopefully knowing how I can set these colors without relying on  
System.Drawing.Color.(something) will be enough to get me on my way.

Many thanks!
Andy - 10 Oct 2007 23:05 GMT
Meant to add - VS2003
Thanks
IfThenElse - 11 Oct 2007 00:27 GMT
Define new color object

System.Drawing.Color newColor = new System.Drawing.Color();

Assign it RGB values or ARGB

newColor = System.Drawing.Color.FromArgb(int red, int green, int blue)

> Meant to add - VS2003
> Thanks
Scott M. - 11 Oct 2007 01:08 GMT
I belive you can also assign non-standard colors via the property window by
directly entering rgb comma separated values:   255,255,255

> Define new color object
>
[quoted text clipped - 6 lines]
>> Meant to add - VS2003
>> Thanks

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.