![]() |
|
|
|
#1 |
|
I have two TextBoxes so a user can enter a start and end date using a
calendar control. I am using the <Calendar1_SelectionChanged> method to input the date in the textbox. My question is this: Is there a way to determine which textbox has focus so when the the user clicks on a date in the calendar control, the date selected is inputted into the textbox with focus? Below is code that I am using. private void Calendar1_SelectionChanged(object sender, System.EventArgs e) { if(txtStartDate.Text == "") txtStartDate.Text = Calendar1.SelectedDate.ToShortDateString(); else txtEndDate.Text = Calendar1.SelectedDate.ToShortDateString(); } =?Utf-8?B?Sm9zZXBo?= |
|
|
|
|
#2 |
|
Posts: n/a
|
in javascript, you could use the onblur event to figure out which
textbox they were in last. Joseph wrote: > I have two TextBoxes so a user can enter a start and end date using a > calendar control. I am using the <Calendar1_SelectionChanged> method to input > the date in the textbox. My question is this: Is there a way to determine > which textbox has focus so when the the user clicks on a date in the calendar > control, the date selected is inputted into the textbox with focus? Below is > code that I am using. > > > private void Calendar1_SelectionChanged(object sender, System.EventArgs e) > { > if(txtStartDate.Text == "") > txtStartDate.Text = Calendar1.SelectedDate.ToShortDateString(); > > else > txtEndDate.Text = Calendar1.SelectedDate.ToShortDateString(); > } neilmcguigan@gmail.com |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to focus the top of the gridview | sureshk | Software | 0 | 05-30-2008 09:40 PM |
| create js object | meera_p9 | Software | 0 | 10-19-2007 07:09 AM |
| Active X cannot create this object | gellison | General Help Related Topics | 0 | 08-09-2007 06:42 PM |