D
DotNetJunkies User
Is there a good way to handle property checking the set procedure if the value being set does not meet the standard criteria?
Right now I just throw an error, and hope the user can handle it. Which works OK in a class, but it causes problems when I use it Custom Controls.
eg
Public Property MySeparator () As String
Get
Return mMySeparator
End Get
Set (ByVal Value As String)
If Len (mMySeparator) > 3 Then
'Is this the right way?
Throw new System.Exception ("Too long!")
Else
Me.mMySeparator = Value
End IF
End Set
Right now I just throw an error, and hope the user can handle it. Which works OK in a class, but it causes problems when I use it Custom Controls.
eg
Public Property MySeparator () As String
Get
Return mMySeparator
End Get
Set (ByVal Value As String)
If Len (mMySeparator) > 3 Then
'Is this the right way?
Throw new System.Exception ("Too long!")
Else
Me.mMySeparator = Value
End IF
End Set