color from Reflection.MemberInfo

  • Thread starter Thread starter Milosz Weckowski
  • Start date Start date
M

Milosz Weckowski

Following Code

Dim t As Type
Dim m As System.Reflection.MemberInfo
t = GetType(Color)
For Each m In t.GetProperties(Reflection.BindingFlags.Public Or
Reflection.BindingFlags.Static)
cmb.Items.Add(m.Name)
Next

But I want to add a color object to the List and not only the name. How to
retrieve a color object from the MemberInfo or the color string ?
Perhaps with color.fromARGB, but how to get the RGB values ?

regards Milosz
 
Dim t As Type
Dim m As System.Reflection.PropertyInfo
t = GetType(Color)
For Each m In t.GetProperties(Reflection.BindingFlags.Public Or
Reflection.BindingFlags.Static)
cmb.Items.Add(m.GetValue(Nothing, Nothing))
Next

Combobox should take advantage of the fact that Color.ToString() returns
color name
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top