Public Class Form1
Private ds As New DataSet
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim dt As New DataTable
ds.Tables.Add(dt)
dt.Columns.Add("DateField", GetType(System.DateTime))
dt.LoadDataRow(New Object() {New DateTime(2005, 8, 4)}, True)
dt.LoadDataRow(New Object() {Nothing}, True)
dt.LoadDataRow(New Object() {New DateTime(2005, 8, 5)}, True)
Dim Mybinding As New Binding("Text", ds.Tables(0), "DateField", True)
Mybinding.FormatString = "MM/dd/yyyy"
Mybinding.NullValue = "No date"
TextBox1.DataBindings.Add(Mybinding)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
'forward
Me.BindingContext(ds.Tables(0)).Position += 1
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
'backward
Me.BindingContext(ds.Tables(0)).Position -= 1
End Sub
End Class