Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Basic Realbasic > Re: Listbox que...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 3304 of 3326
Post > Topic >>

Re: Listbox question

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
 




 3 Posts in Topic:
Listbox question
piltdown <tgtraining@[  2008-02-28 05:54:48 
Re: Listbox question
Dale Arends <dalearend  2008-02-28 19:05:08 
Re: Listbox question
piltdown <tgtraining@[  2008-02-29 18:53:29 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 1:22:04 CDT 2008.