Board index » delphi » combobox to listbox?

combobox to listbox?

Hello all!

on my form I have a combobox and a listbox + a button
the items on my combobox each represents a file on my disk..
text1.txt, text2.txt etc.. etc.

then combobox item selected and I click the button it's supose to load
the textfile to listbox
listbox.loadfromfile ('text1.txt');

I thought I could solve it like this
if combobox.text := 'text1.txt' then
listbox.loadfromfile('text1.txt') else
if combobox.text := 'text2.txt' then

but this really don't work at all.. I looked in the help file, but it
don't have an example for this. Then I got a delphi book from a friend
of mine, but that one did't help much either... so.. I really..really
hope to collect some help/example here?..



Re:combobox to listbox?

Well first of all you cant put a := into a query as := assigns a value
but does not query it. But further I think it would be more simple if
you code this in this way.


Author of the free Chatsystem PINO!
Available at

Re:combobox to listbox?


Okay.. neat way to solve the problem... I renamed the files to text1.
text2.   etc. .etc..

but  how do I save to chose files

 listbox.items.savetofile(combobox.text);    ?????

Other Threads