Welcome, Guest
Username: Password: Remember me
Discussions for CodeTyphon Object Pascal Programming Language
  • Page:
  • 1

TOPIC:

Listbox question 8 years 1 month ago #10054

  • Peter Pohlmann
  • Peter Pohlmann's Avatar Topic Author
  • Visitor
  • Visitor
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.

Listbox question 8 years 1 month ago #10055

  • Peter Pohlmann
  • Peter Pohlmann's Avatar Topic Author
  • Visitor
  • Visitor
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.

Listbox question 8 years 1 month ago #10056

  • Peter Pohlmann
  • Peter Pohlmann's Avatar Topic Author
  • Visitor
  • Visitor
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.

Listbox question 8 years 1 month ago #10057

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Thanks Sir
CodeOcean have many samples for TListbox
PilotLogic Architect and Core Programmer

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

Listbox question 8 years 1 month ago #10058

  • Peter Pohlmann
  • Peter Pohlmann's Avatar Topic Author
  • Visitor
  • Visitor
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.

  • Page:
  • 1