Help on listbox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • soso
    Indigo Rose Customer
    • Jan 2007
    • 73

    Help on listbox

    Wonder if anyone can help with listbox, im trying to search for a ini file and then when u click the name in the list box it gives certain info of the ini in another listbox.

    I have the search feature working but can't seem to get the click the serach items in the listbox to show the ini info i want.

    Any help please if you can

    best

    soso
  • Desrat
    Forum Member
    • Nov 2006
    • 240

    #2
    post the code you have already please, it's kinda difficult to help without seeing what you have so far..

    Comment

    • soso
      Indigo Rose Customer
      • Jan 2007
      • 73

      #3
      Ohh sorry about that this is what i have so far this just like copys everything in a text but i want to pick out like a certain line in a ini instead off copy everything.

      Code:
      -- Get the selected index
      nSelected = ListBox.GetSelected(this)[1];
      
      -- make sure something is actually selected
      if nSelected then
      	-- Get the file path from the item's data
      	sFilePath = ListBox.GetItemData(this, nSelected);
      	
      	-- Load the cities from the file into a table
      	tCities = TextFile.ReadToTable(sFilePath);
      	
      	-- Prevent the listbox from updating	
      	ListBox.SetUpdate("Listbox2", false);
      	
      	-- Remove all previous loaded cities
      	ListBox.DeleteItem("Listbox2", -1);
      	
      	-- Add all cities to the listbox
      	for nIndex, sCity in tCities do
      		ListBox.AddItem("Listbox2", sCity);
      	end
      	
      	-- Allow the listbox to update itself
      	ListBox.SetUpdate("Listbox2", true);
      end
      Cheers soso

      Comment

      • RizlaUK
        Indigo Rose Customer
        • May 2006
        • 5478

        #4
        this just like copys everything in a text but i want to pick out like a certain line in a ini instead
        use:
        Code:
        result = INIFile.GetValue(_WindowsFolder.."\\My Settings.ini", "My Section", "My Value");
        Embrace change in your life, you never know, it could all work out for the best

        Comment

        • soso
          Indigo Rose Customer
          • Jan 2007
          • 73

          #5
          thanks for the reply

          Cheers Soso

          Comment

          • sima
            Forum Member
            • Aug 2009
            • 6

            #6
            plz EXAMPLE file thanks

            Comment

            Working...
            X