mathes
asked on
Problem with listboxes
Hi experts,
I have a problem with Listboxes.
How can I assign the content of the currently selected item of a listbox to
a TEdit control?
I tried it like this
procedure TargetListBoxClick(Sender: TObject);
begin
Ā Edit1.Text:=TargetListbox. itemindex;
end;
but here Delphi complains about incompatible data types
(string and integer)
Any suggestions for a correct solution?
I have a problem with Listboxes.
How can I assign the content of the currently selected item of a listbox to
a TEdit control?
I tried it like this
procedure TargetListBoxClick(Sender:
begin
Ā Edit1.Text:=TargetListbox.
end;
but here Delphi complains about incompatible data types
(string and integer)
Any suggestions for a correct solution?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oh, Jim sorry...you've answered...your answer is even better ;-)
Regards,
Viktor Ivanov
Regards,
Viktor Ivanov
ASKER
Hi experts,
thank you all for your comments. This is exactly what I was looking for.
With kind regards
Christian
thank you all for your comments. This is exactly what I was looking for.
With kind regards
Christian
I just added Listbox.Items.Strings[List box.ItemIn dex];
because in Builder C++ you can not use only Items[] and need to use Item.Strings[]
Otherwise the idea is the same ;-)
Regards,
Viktor Ivanov
because in Builder C++ you can not use only Items[] and need to use Item.Strings[]
Otherwise the idea is the same ;-)
Regards,
Viktor Ivanov
DaEdit.Text := DaListBox.Items.Strings[Da
Regards,
Viktor Ivanov