Understanding TListBox documentation? lazarus / 31-LCL ---------------------------------------------------------------------- undermanager · 2012-06-07 18:02 In my quest to understand how to read the Wiki documentation for components, I have been struggling to work out the documentation for returning an item in a listbox. I currently have this in a program: countrySelected := lboCountry.Items[lboCountry.ItemIndex] which I know returns the country that was selected as a string. I got this from an example I found on the Internet, but how could I have worked this out from the documentation, please? I looked here: http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tlistbox.html    and then selected Items, which took me here: http://lazarus- ccr.sourceforge.net/docs/lcl/stdctrls/tcustomlistbox.items.html I just don't see how that documentation would help someone to realise that what was returned is the item selected as a string! Clearly, I am missing something here. Could someone have a go at explaining what I am doing wrong, please? I'm really trying hard to get my head around this documentation! Thanks ---------------------------------------------------------------------- typo · 2012-06-07 18:12 countrySelected is certainly a string. Code: [Select] lboCountry.Items[x] returns the contents of (x + 1)th item, which is a string. ---------------------------------------------------------------------- ludob · 2012-06-07 18:37 In http://lazarus- ccr.sourceforge.net/docs/lcl/stdctrls/tcustomlistbox.items.html you see TCustomListBox.Items: TStrings. Click on TStrings : http://lazarus-ccr.sourceforge.net/docs/rtl/classes/tstrings.html. There you find Code: [Select]property Strings: String; default; [rw] Indexed access to the strings in the list. More help here http://lazarus- ccr.sourceforge.net/docs/rtl/classes/tstrings.strings.html So normally the access to a string in the tlistbox should be Code: [Select]lboCountry.Items.Strings[i]but you'll notice the  "default" which means that Strings is the default property for TStrings and that you can drop it http://www.freepascal.org/docs-html/ref/refsu33.html. So above can be written as Code: [Select]lboCountry.Items[i] ---------------------------------------------------------------------- undermanager · 2012-06-07 21:23 Thanks ludob. That makes sense now.