by Dale Arends <dalearendssafe@[EMAIL PROTECTED]
>
Feb 28, 2008 at 07:05 PM
piltdown <tgtraining@[EMAIL PROTECTED]
> wrote in news:a5022ca9-2fd4-4181-a6b9-
2b5231af9a7d@[EMAIL PROTECTED]
> I have a listbox with two columns (an integer and a string). I want to
> pass the integer to a routine when the user clicks on a listbox row.
>
> I entered the code in the CellClick function as below:
>
> id =listbox1.cell(listbox1.listindex,0)
>
> so that variable id could be used to store the integer.
>
> Viewing id in an editfield first gives me every single id in the list.
> Clicking again on a row I get the correct value for the previous
> click.
>
> Thanks for any help.
I get what you're trying to do but you're using the wrong index. The
CellClick function receives the parameters from the system, one of which
is the row clicked in. So, using
id =listbox1.cell(row,0)
will get you what you want. ListIndex won't work properly since the
CellClick event fires first.
- Dale