Weblistbox stays -1 on first click

Hi all…beginner question

ListIndex is -1 when no rows are selected, so why when I select a populated weblistbox, does it remain -1 ? (it goes blue)

in CellClick of my Fontlistbox is this… but x always lags one behind… why?

	If Me.ListIndex <>  -1 Then
			x =  Me.List(Me.ListIndex) 
	End If

Thanks.

Because Listindex is not already set at this point. In that event you have row as parameter for the row you clicked in…

Listindex is set the 2nd time user clicks the listbox. How can I do something on the first click. thanks Marius

I’m not getting this at all :-/

As I said. ListIndex is set AFTER that Event. Use the value in row property in this event:

x = Me.List(row) 

you don’t need the “if”

got it working! thanks!