Michael,
I thought with format you did mean the width the height etc. Now I
understand you want an example from the format and parse event from the
datatables.
I have sand already this sample to this newsgroup however I make it more
complete in accoording to my previous message. I changed it in this message
so watch typos.
\\\\
Private Sub form_load etc.
dim textboxArray as Textbox() = New Textbox() {Textbox1, Textbox2, etc}
for i as integer = 0 to textboxArray.length - 1
myroutine(i)
end sub
next
Private Sub myroutine(byval box as integer)
Mybinding = New Binding("Text", ds.Tables(0), "mydatfield")
textboxArray(box).DataBindings.Add(Mybinding)
AddHandler mybinding.Format, AddressOf DBdateTextbox
AddHandler mybinding.Parse, AddressOf TextBoxDBdate
End sub
Private Sub DBdateTextbox(ByVal sender As Object, _
ByVal cevent As ConvertEventArgs)
If cevent.Value Is DBNull.Value Then
cevent.Value = ""
Else
Dim datum As Date
datum = CDate(cevent.Value)
cevent.Value = datum.ToString("dd - MM - yyyy")
End If
End Sub
Private Sub TextBoxDBdate(ByVal sender As Object, _
ByVal cevent As ConvertEventArgs)
If cevent.Value.ToString = "" Then
cevent.Value = DBNull.Value
End If
///
I hope this helps?
Cor