Click here to Skip to main content
13,145,068 members (55,420 online)
Rate this:
Please Sign up or sign in to vote.
See more:
in that i have two fields date of birth and wedding day.

Date of Birth Textbox1 calendar

Wedding Day Textbox2

when i click the calendar taht particular date to be displayed in texbox1 then i click the same calendar in textbox2 Wedding day date to be displayed.

how to do using one calendar.

for that please send the code in with c sharp.
Posted 20-Dec-12 20:52pm
Krunal Rohit 21-Dec-12 3:28am
Any efforts so far ??
Richard MacCutchan 21-Dec-12 5:52am
Don't use text boxes, just use two calendar controls.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Two calendar controls would probably be a better approach but you could use the Enter method of the textboxes to "signal" to the calendar control which one should be populated. E.g.

private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
            TextBox tb = (TextBox)monthCalendar1.Tag;
            tb.Text  = monthCalendar1.SelectionStart.ToString();
        private void textBox1_Enter(object sender, EventArgs e)
            monthCalendar1.Tag = textBox1;
        private void textBox2_Enter(object sender, EventArgs e)
            monthCalendar1.Tag = textBox2;

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170915.1 | Last Updated 22 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100