I have a list box with a bunch of dates in it. I also have a MonthView control. I'd like to click a date in the MonthView and have the listbox scroll to the first instance of that date in the list, and select it. I have no idea how to do it so my code isn't much but here it is:
Code:Private Sub mntPickDate_DateClick(ByVal DateClicked As Date) Dim intIndex As Integer For intIndex = 0 To lstHistory.ListCount If InStr(1, lstHistory.List(intIndex), Format(DateClicked, "mmmm dd, yyyy")) Then Exit For 'change this to whatever will scroll to the item and select it End If Next intIndex MsgBox "No activity was found for the date selected.", vbExclamation + vbOKOnly, "Date Not Found" mntPickDate.Visible = False End Sub




Reply With Quote