Um, the KnownColor enumeration that I just demonstrated for you.I've been trying, without success, to find where to access a 'look-up' list to compare the text with the known colours.You don't have to add anything to any array. You seem to have missed the principle the example was demonstrating. The line that matters there is this one:
where s is the String value you want to test. In your case, that String value is TextBox1.Text so you substitute that for s, e.g.vb.net Code:
If [Enum].IsDefined(GetType(KnownColor), s) Then
vb.net Code:
Dim colourName = TextBox1.Text If [Enum].IsDefined(GetType(KnownColor), colourName) Then Dim colour = Color.FromName(colourName) 'Use colour here. Else 'There is no such colour. End If




You don't have to add anything to any array. You seem to have missed the principle the example was demonstrating. The line that matters there is this one:
Reply With Quote