12,295,457 members (56,836 online)
Rate this:
See more:
I have 2 text boxes on the form. First one is to enter a date, for example 28/1/2013. and the second one will get the result by increasing the date value of first text box by 3 years.
Can I achieve this task? if so, please tell me how? I know the code for this task should be written in textchanged event. But don't know what should I write.
Posted 27-Jan-13 20:03pm
Edited 27-Jan-13 20:04pm
v2

Rate this:

## Solution 5

```Dim c As New DateTime(2013, 1, 28)

```
suhan 2012 28-Jan-13 3:31am

It works now. Thanks.
Rate this:

## Solution 1

What about: DateAndTime.DateAdd[^] with `DateInterval.Year`?
Rate this:

## Solution 2

Hi,

for increment date by 3 years
you can write the syntax like this...

```currentDate=currentDate.AddYears(3);
```

Rate this:

## Solution 4

Dim textBox1Date as DateTime;

textBox1Date=DateTime.Parse(TextBox1.Text);

Dim newDate as DateTime;

TextBox2.Text=String.parse(newDate);
suhan 2012 28-Jan-13 3:31am

Thanks.

Top Experts
Last 24hrsThis month
 OriginalGriff 515 Richard MacCutchan 435 Karthik Bangalore 319 Peter Leow 258 Dave Kreskowiak 236
 OriginalGriff 8,825 ppolymorphe 5,362 CHill60 5,260 Karthik Bangalore 4,726 Sergey Alexandrovich Kryukov 4,460