PDA

View Full Version : listview event handling confusion


LoneRobot
07-18-2005, 03:05 PM
Hi all,

im having a bit of a monday brain day and cant get my head around this in the MXS help

on <control_name> ItemClick Item:ListItem do ( ... )

Called when the user clicked a ListItem. The Item argument will contain the 0-based index of the row that has been clicked.

I thought it would mean something like this-

on lv ItemClick numb do
(
messagebox (numb as string)
)

so clicking the particular row would return the box number integer, a bit like a listbox

since ive built the listview via an array -

for o = 1 to sr_all_files.count do
(
li = lv.ListItems.add()
li.text = rname[o]
)
id hoped to put an event handler that could reference the item in that array, ie lv.listitem[a] triggers and event that does something to rname[a]

when i try ths method all i get in the messagebox is the string "listitem"

am i addressing the wrong bit, ie the active x itself and not the listitems? :shrug::hmm:
can anyone help me out?

LoneRobot
07-18-2005, 04:04 PM
okay i think i figured it out.


on lv ItemClick numb do (messagebox (numb.Index as string))


i can now use this to reference my array in an event.

i guess the "the Item argument will contain the 0-based index of the row that has been clicked."

means that the numb variable has to be accesed with the numb.Index command to access the listview box that has been clicked. duh!!! :shrug:

CGTalk Moderation
07-18-2005, 04:04 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.