Calendar control

MaD-d0g used Ask the Experts™
How can I select mulitple dates in the calendar control ?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
'this code will determine how many dates are selected

Public Sub Calendar1_SelectionChanged (ByValControls As Object, _
      ByVal e As EventArgs)
   Text1.Text = "You selected " & _
      Calendar1.SelectedDates.Count " & date(s)."
End Sub

' this gets the range of a multi date selection

Public Sub Calendar1_SelectionChanged (ByValControls As Object, _
      ByVal e As DayRenderEvent)
   If Calendar1.SelectedDates.Count > 1 Then
      Dim FirstDate as DateTime
      Dim LastDate as DateTime
      FirstDate = SelectedDates[0]
      LastDate = SelectedDates[SelectedDates.Count - 1]
      txtFirstDate.Text = FirstDate.toString
      txtLastDate.Text = LastDate.toString
   End If
End Sub


this code doesnt show me how to select multiple dates...
cant u select dates like and assign each one to a txtbox?

or is that too hard lol!
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!


Im sorry, I just dont understand...
Is the code that you wrote applies to Microsoft Calendar Control 8 or to a different control ?

how can I DISPLAY different dates by code,
like 01/11/02, 05/11/02, 19/11/02.

Thank you for your time.
Public Sub Calendar1_SelectionChanged(ByVal sender As Object, _
   ByVal e As System.EventArgs) _
   Handles Calendar1.SelectionChanged
   Text1.Text = "You selected " _
      & Calendar1.SelectedDates.Count.ToString() _
      & " date(s)."
End Sub

this may work, you cant select multiple dates one after the other you will have to select each and assign them to a list or somethin.

this site may help ya if you dont understand


This is VB.Net and C#
I need to do it in VB 6
Author of the Year 2009

Hi MaD-d0g,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

MaD-d0g, Please DO NOT accept THIS comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
DanRollins -- EE database cleanup volunteer
per recommendation

Community Support Moderator @Experts Exchange

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial