G
Guest
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();
}
Thanx
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();
}
Thanx