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
 
Back
Top