Archive: Getting Selected value from List Box


Getting Selected value from List Box
Hi All,

I have two text fields on the left of a page
Database
Port

On the right I have a List box.

Between them I two buttons "Add >>" and "<< Remove".

I have the Add button adding the values ( with a - separator) in the text boxes to the list box in order. It then blanks the text boxes.

I have the remove button removing the highlited entry from the list box using the index.

However I want the text boxes to populate with the values in the list box when a user selects a row in the listbox. But I can't get the actual values back out.

I've found two excellent threads on the forum that have got me this far. However the way they got data back out was to loop through all entries.

I've tried a couple of LB* send messages but can't get it to work.

any ideas?

Regards,
John


You can read the values directly from the INI file, there's no need to mess with LB_* messages.


Thanks, I'd prefer to stick to send message for everything. I will look up reading the INI file if I need to. I'm thinking of writing my own function to send message and get all values and loop through them passing back the value at the required index. I can gett hsi from somewheer on the forum. It would be nice to get the send message working.

Regards,
John