Kerry,
Thanks
I will see if I can implement it, a problem with checking for nulls is often
that it makes the sample more difficult to read. It is about to tell how it
can be done.
"Learning to fish not giving the fish".
I started this were I needed it for dates before 1753 and than raised those
by 3000
Maybe I make 2 samples from it.
Cor
"Kerry Moorman" <(E-Mail Removed)> schreef in bericht
news:4556C419-DB82-4A69-BA80-(E-Mail Removed)...
> Cor,
>
> Here is your example changed to use FormatString and NullValue properties:
>
>
Code:
> 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
>
>
> Kerry Moorman
>
>
> "Cor Ligthert[MVP]" wrote:
>
>> You can at least use format events
>>
>> http://www.vb-tips.com/DataBindingEvents.aspx
>>
>> Cor
>>
>> "Kyote" <(E-Mail Removed)> schreef in bericht
>> news:(E-Mail Removed)...
>> >I have a textbox that is databound to a table in an access database.
>> > The field only contains month/day/year but my databound textbox is
>> > also showing a time. Is there any way to prevent it from doing this?
>> >
>> > ---
>> > Kyote
>>
>>