My question is: is there any event can be fired when an instance of
MyDateBox databinding.add("Text",dv,"datecolumn"), so I can call
WireBinding sub in that event. Right now, I have to call the public sub
WireBinding after every databinding.add statement.
Public Class MyDateBox
Inherits MyMaskedTextBox
Private WithEvents _b As Binding
Public Sub New()
Me.Mask = "00/00/0000"
End Sub
Public Sub WireBinding()
_b = Me.DataBindings("Text")
End Sub
Private Sub _b_Parse(ByVal sender As Object, ByVal e As
System.Windows.Forms.ConvertEventArgs) Handles _b.Parse
If Me.InputText = String.Empty Then
e.Value = DBNull.Value
End If
End Sub
End Class
|