Click here to Skip to main content
12,508,491 members (54,925 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
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 asp.net with c sharp.
Posted 20-Dec-12 20:52pm
Comments
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
 
good
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;
        }
  Permalink  

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 | Mobile
Web02 | 2.8.160927.1 | Last Updated 22 Dec 2012
Copyright © CodeProject, 1999-2016
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