|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Convert string to KnownColor?I have a piece of code that is trying to convert a string to a
knownColor via CType. Is this not possible? I keep getting an error that you cant convert a string to an integer. Is there another way to do this? For Each clr as object In Colors If Not Color.FromKnownColor(CType(clr, KnownColor)).IsSystemColor Then alColor.Add(clr.ToString) End If Next Thanks so much. >Is there another way to do this? System.Enum.ParseMattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. On Apr 5, 5:40 pm, Mattias Sjögren <mattias.dont.want.s***@mvps.org>
wrote: > >Is there another way to do this? Thank you so much!> > System.Enum.Parse > > Mattias > > -- > Mattias Sjögren [C# MVP] mattias @ mvps.orghttp://www.msjogren.net/dotnet/|http://www.dotnetinterop.com > Please reply only to the newsgroup. |
|||||||||||||||||||||||