Color problem

S

shapper

Hello,

I have a property of type System.Drawing.Color in a custom control:

<Bindable(True), Category("Layout"), DefaultValue(""),
Localizable(True)> Property BColor() As Drawing.Color
Get
If CStr(ViewState("BColor")) Is Nothing Then
Return Drawing.Color.White
Else
Return Drawing.Color.Parse(CStr(ViewState("BColor"))) End If
End Get
Set(ByVal Value As Drawing.Color)
ViewState("BColor") = Value
End Set
End Property

My problem is in line where I placed the word "ERROR".
If the property would be of type integer I would do:

Integer.Parse(CStr(ViewState("BColor")))

How can I solve this?

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top