K
Keith Roe
I'm binding the 'Name' property of my object to the 'text' property of a
text box as follows:
txtName.DataBindings.Add(propertyName:="Text", dataSource:=obj,
dataMember:=pi.Name)
When the Property Set of the object is called I am attempting to throw an
exception as follows:
Public Property Name() As String
Get
Return mName
End Get
Set(ByVal Value As String)
If Value.Length > 2 Then
Throw New Exception(Message:="Region 'Name' cannot be
greater than 50 characters")
End If
mName = Value
mDirty = True
End Set
End Property
How do I get a handle on the call to the set statement in order to catch the
exception and display a message to the user? Right now if the user enters
more than 50 characters and presses the save button the excpetion is going
somewhere (I can't figure out where) and the user is unable to close the
form without correcting the entry.
text box as follows:
txtName.DataBindings.Add(propertyName:="Text", dataSource:=obj,
dataMember:=pi.Name)
When the Property Set of the object is called I am attempting to throw an
exception as follows:
Public Property Name() As String
Get
Return mName
End Get
Set(ByVal Value As String)
If Value.Length > 2 Then
Throw New Exception(Message:="Region 'Name' cannot be
greater than 50 characters")
End If
mName = Value
mDirty = True
End Set
End Property
How do I get a handle on the call to the set statement in order to catch the
exception and display a message to the user? Right now if the user enters
more than 50 characters and presses the save button the excpetion is going
somewhere (I can't figure out where) and the user is unable to close the
form without correcting the entry.