error during listbox drawitem event
i've got a listbox that is set to ownerdrawfixed and multiselect.
in the drawitem event i check if the index of the item being drawn is the selected index or if the index of the item is in the selectedindices collection. when i run the code and the selection changes in the list i get an error in the code.
Ife.Index = -1ThenExitSubIfMe.lst.SelectedIndex =e.IndexThen'error occurs hereElseIfMe.lst.SelectedIndices.Contains(e.Index)Then'error only occurs if this line existsElseEndIfwhy do i get an error because of a line further down in my code when it hasn't yet reached that line. if i remove that line there is no problem.
can someone please explain why this error occurs

