1.11M Members

Change label forecolor through selected combobox item..


Hi guys. I just need help with something. Bascailly I've got a combobox which has all the colors e.g. color.black, color.blue etc and what I want to do is when the user selects the combobox item e.g. selected color.Blue it should change the labels forecolor to what ever the user selected. i.e. blue but i get an error: Here's what i mean: http://puu.sh/4hVTV.png

Question Self-Answered as of 10 Months Ago

Basically this s what I added :
I added this code below to the selectedindexchanged in a combobox.

  Dim c As Color       
           c = Color.FromName(ComboBox1.SelectedItem.ToString)
            Label7.ForeColor = c

In my combobox I've loaded all the colors e.g. color.blue, color.black etc and when I choose one of the colors it changes label7's forecolor to whatever item I choose. I hope this helps anyone out there who was in a similar situation as I was. Enjoy :P

This question has already been solved: Start a new discussion instead
Start New Discussion
Tags Related to this Article