954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Calendar control

hi,

1-how can i do multiselect in calendar.
2-how many days between 2 dates? how can u calculate it?
example :
10/10/2006 - 12/10/2006 there is 1 day between those 2 dates.

thanks

Fenerbahce
Junior Poster in Training
62 posts since Apr 2006
Reputation Points: 15
Solved Threads: 0
 
1-how can i do multiselect in calendar. thanks

Select Calendar control and set SelectionMode property to DayWeek or DayWeekMonth.2-how many days between 2 dates? how can u calculate it?
example :
10/10/2006 - 12/10/2006 there is 1 day between those 2 dates.
thanks

You can use DateDiff function Here is the sample:

DateDiff(DateInterval.Day, MyFirstDate, MyLastDate)<strong>-1</strong>


If you need to count days in Caledar control than simply add this in SelectionChanged event od the Calendar control:

Me.Calendar1.SelectedDates.Count


Hope it helps.

ManicCW
Junior Poster in Training
95 posts since Nov 2005
Reputation Points: 13
Solved Threads: 11
 

Hi ManicCW,

Thank you very much for your help. they work very well.

Kind regards

Fenerbahce
Junior Poster in Training
62 posts since Apr 2006
Reputation Points: 15
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You