none
how to display the time+date in calendar? RRS feed

  • Question

  • Hello,
    I'm looking for
     how to display both date and time selected in the calendar.

    I display the calendar date in TextBox1:
    TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();


    I view the calendar in time textbox2:
    TextBox2.Text = Calendar1.SelectedDate.TimeOfDay.ToString();


    I'm looking for how to display both in textbox3, date and time selected in the calendar?
    thanks
    Friday, May 6, 2011 11:41 AM

Answers

  • You can use textbox3=TextBox2+TextBox1

    Or you can define variables in application date and time and set there values in datechaneg event of Calendar and then use these variable in your text field 3.

    thank you for your answer
    I used:

    TextBox3.Text = Calendar1.SelectedDate.ToString();

    • Marked as answer by loverz08 Monday, June 6, 2011 8:54 AM
    Monday, June 6, 2011 8:54 AM

All replies

  • You can use textbox3=TextBox2+TextBox1

    Or you can define variables in application date and time and set there values in datechaneg event of Calendar and then use these variable in your text field 3.

    Monday, June 6, 2011 7:13 AM
  • You can use textbox3=TextBox2+TextBox1

    Or you can define variables in application date and time and set there values in datechaneg event of Calendar and then use these variable in your text field 3.

    thank you for your answer
    I used:

    TextBox3.Text = Calendar1.SelectedDate.ToString();

    • Marked as answer by loverz08 Monday, June 6, 2011 8:54 AM
    Monday, June 6, 2011 8:54 AM