× Discussions for CodeTyphon Object Pascal Programming Language

Question Listbox question

  • Peter Pohlmann
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
3 years 9 months ago #10054 by Peter Pohlmann
Listbox question was created by Peter Pohlmann
Hello All,

I am pulling my hair out on the listbox . Very common control.

I am trying to get the values of multi select.

I guess it should go like this:

for i=0 to Listbox1.Items.Count-1
begin
if listbox1.Selected then
value:= listbox1.Items.text;
end;

Well that is a no-go on the mac i am using.
Any advise ?

Cheers
Peter

Please Log in or Create an account to join the conversation.

  • Peter Pohlmann
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
3 years 9 months ago #10055 by Peter Pohlmann
Replied by Peter Pohlmann on topic Listbox question
oops .. should have put the glasses on ..

for i:=0 to Listbox1.Items.Count-1 do
begin
if listbox1.Selected then
access_strg:= listbox1.Items.text;
end;

It does not accept .text (illegal qualifier error)

Please Log in or Create an account to join the conversation.

  • Peter Pohlmann
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
3 years 9 months ago #10056 by Peter Pohlmann
Replied by Peter Pohlmann on topic Listbox question
ok got it ..
for i:=0 to Listbox1.Items.Count-1 do
begin
if listbox1.Selected then
begin
access_strg:= listbox1.Items;
showmessage( access_strg);

end;
end;

Use like access_strg:= listbox1.Items; instead of access_strg:= listbox1.Items.text;

Would be nice to find somewhere the documentation ..
Anyways thanks for providing this board here. It is very helpful and thanks for creating codetyphon

Cheers
Peter

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
3 years 9 months ago #10057 by Sternas Stefanos
Replied by Sternas Stefanos on topic Listbox question
Thanks Sir
CodeOcean have many samples for TListbox

PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

  • Peter Pohlmann
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
3 years 9 months ago #10058 by Peter Pohlmann
Replied by Peter Pohlmann on topic Listbox question
Oh oh i forgot all about that . Thank you.
One quick question ..
Is there a way to have a combobox with multiple selections ?
or
Is there a way to make a listbox like a combobox (the drop down feature) ?

Thanks
Peter

Please Log in or Create an account to join the conversation.