View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Multi-select listbox - mousedown event

After serious thinking Greg Lovern wrote :
With a multi-select listbox, when the mousedown event fires when a
user clicks one of the boxes, the Selected property reports the
selection state of the list BEFORE the mouseclick. Since I don't know
what box was clicked, I don't know the selection state of any list
items when that event fires; all I know is that the selection state
one of the list items is different than reported by the Selected
property.

The Enter event also fires if the listbox didn't already have focus,
but it has the same problem.

No other events fire when the user clicks one of the boxes, as far as
I can tell.

Is there any way to get the true selection state of the list when the
user clicks one of the boxes in the list?


Thanks,

Greg


Try this...

Private Sub ListBox1_Change()
Debug.Print ListBox1.ListIndex
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc