How to convert listbox items to date and compare with calendar and bold affected date

  • Thread starter Thread starter Rans-Yaw
  • Start date Start date
R

Rans-Yaw

Guest
Am having some difficulties with converting listbox dates (having the format dd-MM-yyyy) to datetime which i want to compare with monthcalendar date and instruct vb to bolden those dates on the calendar. Below is the novice quote i was trying to use to solve this. I get the following error when i tried running the code "Unable to cast object of type 'ObjectCollection' to type 'System.IConvertible'". I hope professionals on this platform will help me solve this. Thanks.




For Each item In ListBoxDates.Items

Dim listdate As DateTime = Convert.ToDateTime(ListBoxDates.Items)

Dim eventdates() As Date = New Date() {convertdate}

MonthCalendarEvents.BoldedDates = eventdates

Next

Continue reading...
 
Back
Top