Hi there,
I have a listbox control and a calendar control, when ever a user selects the date in the calendar control i want the listview to also highlight this date IF its in the listbox?...I am new to this and I my code below is logically very wrong, its causing an infinite Loop I think, any one any ideas...?
I have a listbox control and a calendar control, when ever a user selects the date in the calendar control i want the listview to also highlight this date IF its in the listbox?...I am new to this and I my code below is logically very wrong, its causing an infinite Loop I think, any one any ideas...?
VB.NET:
Dim get_selected_date As Date
'get selected date from calendar
get_selected_date = MonthCalendar1.SelectionRange.Start
'highlight the seleceted date in the listview1 if it's there
Dim i As Integer
i = 1
Do While ListBox1.Items(i) > 0
If ListBox1.Items(i) = get_selected_date Then
ListBox1.SelectedItem.Equals(get_selected_date)
'turn off loop
i = -1
End If
'increment counter
i = i + 1
Loop