vmandem
asked on
passing dates from the calender to text box
I have a calendar control on the form by name MonthCalendar1
I have two text boxes. I'm trying to pass two dates like start and end date into the text boxes 1 and 2. For that I did like this
Private Sub MonthCalendar1_DateChanged (ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateR angeEventA rgs) Handles MonthCalendar1.DateChanged
txtstartdate.Text = MonthCalendar1.SelectionSt art
txtenddate.text = MonthCalendar1.Selectionen d
end sub
BUT WHEN I SELECT THE FIRST TIME IT COPIES TO BOTH TEXTBOXES. HOW TO GET THE SECOND SELECTION DATE TO SECOND TEXTBOX.
Thanks
VM
I have two text boxes. I'm trying to pass two dates like start and end date into the text boxes 1 and 2. For that I did like this
Private Sub MonthCalendar1_DateChanged
txtstartdate.Text = MonthCalendar1.SelectionSt
txtenddate.text = MonthCalendar1.Selectionen
end sub
BUT WHEN I SELECT THE FIRST TIME IT COPIES TO BOTH TEXTBOXES. HOW TO GET THE SECOND SELECTION DATE TO SECOND TEXTBOX.
Thanks
VM
ASKER
BriCrowe,
It does the same. No change
VM
It does the same. No change
VM
I just use two calendar controls. One for the start date, and one for the end date.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
BriCrowe
This one works fine, what If I want to change the firstdate through the calender. The above code changes only for second date. I'm disabling the textboxes for the users to edit and choose only from calendar.
Thanks
VM
This one works fine, what If I want to change the firstdate through the calender. The above code changes only for second date. I'm disabling the textboxes for the users to edit and choose only from calendar.
Thanks
VM
"This event is similar to DateChanged, but it occurs at the end of a date selection made using the mouse. The DateChanged event occurs during any date selection, whether by mouse, keyboard, or code."