I'm binding a textbox to a property in a business class and the business
class updated correctly when the user keys in some text and the focus leaves
the textbox. When the property its bound to changes, it raises an event in
the UI which updates various visual things. I want these things up update
as the user keys in data and not wait for the focus to leave the textbox.
I'm trying to do this in a way that stays with the them of binding to
business objects and using as little code as possible. How can I get the
binding of the textbox to update the property on the TextChanged event?
'Here's how I'm binding the textbox:
Me.FName.DataBindings.Add("Text", objB, "FName")
'I was thinking of adding this event handler
AddHandler FName.TextChanged, AddressOf TextValChanged
'More textboxes will use the same handler
AddHandler AnotherControl.TextChanged, AddressOf TextValChanged
'But I'm not sure of a good way to proceed
Private Sub TextValChanged(ByVal sender As Object, ByVal e As
System.EventArgs)
Try
'Assuming this is the way to go, what's a generic way to update
the sender's bound property?
Catch ex As Exception
ErrLog(ex)
End Try
End Sub
Thanks.
--
moondaddy@nospam.com