Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


How to get auto calculated expiry date on lost focus event of registration date


How to get auto calculated expiry date on lost focus event of...

Author
Message
frmsasp
frmsasp
Forum God
Forum God (1.5K reputation)Forum God (1.5K reputation)Forum God (1.5K reputation)Forum God (1.5K reputation)Forum God (1.5K reputation)Forum God (1.5K reputation)Forum God (1.5K reputation)Forum God (1.5K reputation)Forum God (1.5K reputation)

Group: Forum Members
Posts: 6, Visits: 7
Hello There,

I am working with c# & I have used two textbox server control.
1> Registration Date
2> Expiry Date
First of all, user enters value for the first textbox namely Registration Date and then the expiry date should be auto calculated by adding 30 days into currently entered registration date when he user leaves the first textbox.

That means there are two textboxes - user enters the value for first textbox and the second textbox should be auto calcuated on lost focus event of first textbox.
So pls let me know..... Waiting for your answer....

Thanks,
Paresh

Attachments
expirydate_original_pic.jpg (2K views, 41.00 KB)
AllenSmith
AllenSmith
Forum God
Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)

Group: Forum Members
Posts: 21, Visits: 335
Hello,

You can use the following code in the LostFocus event of the Textbox1.

BEGIN CODE

DateTime dt;

if(textBox1.Text != "")

{

dt = System.Convert.ToDateTime(this.textBox1.Text);

textBox2.Text = dt.AddDays(30).ToShortDateString();

}

END CODE

I believe this should help.

Regards,

Allen 



Allen Smith



Software Engineer

ComponentOne LLC

www.componentone.com
Edited
12/10/2007 by AllenSmith
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search