|
#1
|
|||
|
|||
|
Hi all,
First I'm new with TrueUpdate and LUA language. I just downloaded the TrueUpdate 3.0 Trial version and try to use a ListBox in a dialog. So I added a DlgListBox from the screen gallery in the wizard, changed the Style to "Checklist Box" and checked the "Multi select" option. In the "On Next" action tab, I just want to display (for debug checking) the name of all selected items. To do this, I added this code : -------------------------------------- local Selected = DlgListBox.GetSelected(CTRL_LIST_BOX); local index; local value; for index,value in Selected do Dialog.Message( "Selection ", index..value, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end -------------------------------------- Even if I selected more than one Item, the GetSelected function always returned only the last item I selected. Moreover, If I display the existing variable "nSelectedCount" (result of "DlgListBox.GetSelectedCount") it always display "1". Could someone help me to obtain the complete list of selected items ? Thanks a lot. Olivier Chivet |
|
#2
|
||||
|
||||
|
Hello,
DlgListBox.GetSelected returns a table only if the ListBox is not set to Checklist Box. See this instead: Code:
for i = 1, DlgListBox.GetCount(CTRL_LIST_BOX) do
tProperties = DlgListBox.GetItemProperties(CTRL_LIST_BOX, i);
if (tProperties.Checked) then
Dialog.Message( "Selection ", i .."=" .. tProperties.Text, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
end
|
|
#3
|
|||
|
|||
|
Hello upeters,
Thank you for your code, It works fine. And sorry for my misunderstanding between "(Get)Selected" and "Checked". Quote:
Best regards. |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Checking to see if a combo box has been selected. | Barney | Setup Factory 7.0 Discussion | 2 | 06-19-2008 03:33 AM |
| Missed the Boat | JerryQuinn | AutoPlay Media Studio 6.0 | 9 | 11-23-2005 06:18 PM |
| ListBox.GetItemData from selected item | lnd | AutoPlay Media Studio 6.0 | 5 | 10-14-2005 01:32 PM |
| help with ftp connect | CAI | AutoPlay Media Studio 6.0 | 0 | 09-29-2005 08:13 PM |
| ListBox remove selected item? | woter324 | AutoPlay Media Studio 5.0 | 1 | 06-17-2005 06:03 AM |
All times are GMT -6. The time now is 04:35 AM.








Linear Mode

