PDA

View Full Version : Help on listbox



soso
06-25-2007, 12:00 AM
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
06-25-2007, 04:04 AM
post the code you have already please, it's kinda difficult to help without seeing what you have so far..

soso
06-25-2007, 04:37 AM
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.


-- 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

RizlaUK
06-25-2007, 11:06 AM
this just like copys everything in a text but i want to pick out like a certain line in a ini instead

use:

result = INIFile.GetValue(_WindowsFolder.."\\My Settings.ini", "My Section", "My Value");

soso
06-29-2007, 04:31 AM
thanks for the reply

Cheers Soso

sima
08-31-2009, 04:16 PM
plz EXAMPLE file thanks