Value of type string cannot be converted to System.Drawing.Color Error
Posted on 2007-10-10
I created a VB.NET 2005 color template form that allows the user to select a color to be used for the form text controls. The value is stored in the Public Property UserProfileColorGet() As String. For example, the user selects color A which equals color.yellow. My problem is the following code gives me an error that reads: Value of type string cannot be converted to System.Drawing.Color
Private Sub txtSO_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSO.Leave
Dim sColor As String = oCon.UserProfileColorGet
Me.txtSO.BackColor = sColor
How can I fix this problem?