10-11-2011, 07:43 PM
Not to thread steal, but here is a more efficient version. I couldn't get the auto color loads to work properly so I had to look up a source for it. Using lots of if statements isn't good and you can also use the select case method next time. Its a lot less code.
Code:
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim Col As Color
For Each f In System.Enum.GetNames(GetType(System.Drawing.KnownColor))
Col = Color.FromName(f)
If Col.IsSystemColor = False Then ComboBox1.Items.Add(Col)
Next
'Source for this http://www.vbdotnetforums.com/component-development/28782-color-combobox.html
End Sub
Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedValueChanged
TextBox1.ForeColor = ComboBox1.SelectedItem
End Sub
End Class