VishalMistry
3rd October 2016, 13:41
Hello everyone,

I am experimenting with 3gl user interface objects and created a list box with several items in it.

Following code gives id of selected item from listbox, but how can we get string associated with selected item of listbox ?

get.object(l.list, DsNselectedId, si)

I searched on the forum but could not find anything except Mark's post containing above line.

Thanks,
Vishal

bhushanchanda
3rd October 2016, 17:11
Hi,

First you need to create a string array with all your list items in the list box.

Say -
string myitems(10,300)
myitems(1,1) = "article"
myitems(1,2) = "printers"
myitems(1,3) = "graph"
myitems(1,4) = "books"
myitems(1,5) = "logo"


Now, in your event loop you can get the id using -

case EVTLISTBOXSELECT:
combox_id = evt.listbox.item_id(event)

combox_id will have the index of the list item.

Now, just use myitems(1,combox_id) to get the related string -

e.g.

message(myitems(1,combox_id))

VishalMistry
6th January 2017, 11:57
Hi Bhushan,

Sorry for replying late. Actually I am on Baan IV. So can you guide me how this can be handled on Baan IV ?

I shall be grateful if you put up a small example in related to Baan IV.

Vishal