Click here to Skip to main content
15,843,727 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
using calendar Display selected date in textbox.


Date textbox (Calendarimage)

in calendar i choose 15 feb means that date will display textbox.

how can i Do. Please reply.

Note It is windows application.


regards
Narasiman P.
Posted

There is no Calender control in standard WinForms: the DateTimePicker is about the closest, and it always shows the date in a text box style display anyway, with the actual calender requiring the control to be opened.

So, if you are using some other control, we can't help you display information from it without knowing details about the actual control.

But, as a general rule, look for a "ValueChanged" or "DateChanged" event, and handle that to display what you need.
 
Share this answer
 
Hi Narasima,

You should use DateTimePicker control in your Windows Forms. and use Below Code to display the date in text box

C#
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
        {
            DateTime dt = dateTimePicker1.Value;
            textBox1.Text = dt.ToString("dd-MMM-yy");
        }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900