Here is a small piece of code that does what you want:
Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Calendar1.SelectionChanged
TextBox1.Text = Calendar1.SelectedDate.ToShortDateString()
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.TextChanged
Calendar1.SelectedDate = CDate(TextBox1.Text)
End Sub
Take note, however, that you need to have some way of doing a postback when
the TextChanged event occurs, such as a separate Button in which you can
place the code I put in the TextChanged event, or you can set the
AutoPostBack property to True. Although it is not a requirement, you may
also want to add validation to make sure the date entered in TextBox1.Text
is a valid date before attempting to assign it to Calendar1.SelectedDate.
Good Luck!
--
Nathan Sokalski
nj********@hotmail.com http://www.nathansokalski.com/
"Learner" <pr****@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi there,
I have a text box in my webform to type in a date. I want to take
advantage and use the calender control to let the user just to click on
the clander and select a date. How do i program this? is there a link
with a code snippet?
Thanks
-L