Convert color from string

To convert a color from a string use the ColorConverter class but this can be access through TypeConverter class;

  1. Dim myColor as Drawing.Color
  2.  
  3. Dim clor As System.ComponentModel.TypeConverter = System.ComponentModel.TypeDescriptor.GetConverter(GetType(Drawing.Color))
  4.  
  5. myColor = clor.ConvertFromString("Blue")

MyColor variable is  now ready to use.

, ,

  1. No comments yet.
(will not be published)
Submit Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Subscribe to comments feed
  1. No trackbacks yet.

SetPageWidth