473,326 Members | 2,813 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,326 software developers and data experts.

System.Drawing.Color, iterate through properties

Hi,

Is there a way ( perhaps throgh refleksion) to iterate through the colors of
the System.Drawing.Color struct.

foreach (Color color in .... i dont know....

regards Jesper
May 17 '07 #1
1 6244
Use the System.Type class, by using typeof(System.Drawing.Color). This
returns an instance of the Type class. You can then use the GetProperties
method to get all of the properties as an array of
System.Reflection.PropertyInfo instances and iterate through the array.

See http://msdn2.microsoft.com/en-us/lib...stem.type.aspx

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Jesper, Denmark" <Je***********@discussions.microsoft.comwrote in message
news:99**********************************@microsof t.com...
Hi,

Is there a way ( perhaps throgh refleksion) to iterate through the colors
of
the System.Drawing.Color struct.

foreach (Color color in .... i dont know....

regards Jesper

May 17 '07 #2

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

Similar topics

0
by: Supra | last post by:
: error BC30311: Value of type 'System.Drawing.Color' cannot be converted to 'Integer'. Function doColor(ByVal rtb As RichTextBox, ByVal a As String, Optional ByVal f As Integer = 0, Optional...
4
by: andrewcw | last post by:
I have an xml file that I use to set values of DataGridStyles - header text, column width etc I would also like to make the background color selected other items data driven What is the smart way...
10
by: tshad | last post by:
I have a problem setting the background color of textbox on the fly. I tried using: applicantID.backcolor = "F6F6F6" and applicantID.backcolor = "#F6F6F6"
3
by: Rich | last post by:
I need to change my form's backcolor back to the design color after it changes to another system.Drawing.Color. In the backcolor design, the value is in RGB me.BackColor = ...RGB(255, 255, 192)...
4
by: Steve | last post by:
I'm a bit baffled. I'm fairly new to VB.NET so maybe I'm missing something. I'm creating a class that has some application-specific methods and properties and one thing I'd like to do is define...
11
by: Yaniv | last post by:
Hi How can I convert Uint32 variable to System.drawing.color ?? Thanks in advanced Yaniv
6
by: James Hahn | last post by:
That looks like proper Property set code to me. What is the line of code that the designer is generating in the Sub InitializeComponent for a color that you select in the Properties Settings? ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.