Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007
    Posts
    21

    About Listbox_easy4u but hard4me

    I have tried to solve my problem about listbox for many hours but I didn't solve it yet.
    the problem is when I select the first item on listbox 1 (blocked by blue colour), I wanted at the same time, the first item on ListBox2 and ListBox 3 are selected and blocked by blue colour too.
    These the codes :

    tbSel = ListBox.GetSelected("L1");
    if tbSel then
    ListBox.GetSelected("L2",tbSel[1]);
    ListBox.GetSelected("L3",tbSel[1]);
    end

  2. #2
    Join Date
    Sep 2010
    Location
    Barcelona Spain
    Posts
    599
    Quote Originally Posted by Jordanfernando View Post
    ...the problem is when I select the first item on listbox 1 (blocked by blue colour), I wanted at the same time, the first item on ListBox2 and ListBox 3 are selected and blocked by blue colour too.
    Try this On Select Event ListBox1:

    Code:
    -- Make sure multiple selection is disabled in all List Boxes.
    
    -- Get the indexes of the items currently selected in the listbox.
    selected_items = ListBox.GetSelected("ListBox1");
    
    -- If there were items selected in the listbox, display a dialog with their indexes.
    -- If no items were selected, display a notification message.
    if (selected_items ~= nil) then
        output = "";
        for index, item in pairs(selected_items) do
            output = output..item.."\r\n";
            if item == 1 then ListBox.SelectItem("ListBox2", 1) ListBox.SelectItem("ListBox3", 1)end;
            if item == 2 then ListBox.SelectItem("ListBox2", 2) ListBox.SelectItem("ListBox3", 2)end;
            if item == 3 then ListBox.SelectItem("ListBox2", 3) ListBox.SelectItem("ListBox3", 3)end;        
        end    
        Dialog.Message("Selected Items", "The indexes of the selected items are:\r\n\r\n"..output);      
    else
        Dialog.Message("Selected Items", "There are no selected items in the listbox.");
    end
    Hope it helps.

  3. #3
    Join Date
    May 2007
    Posts
    21
    I tried your codes and it works. thank you very very much O'callaghan.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts