• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

adding to a listbox

I know this code is wrong, but can someone correct my code to allow multiple items to be added to a l;ist box.

flatListBox1.Items.Add(Name.Text) and (address.Text) and (index2.text);
0
gollygood
Asked:
gollygood
  • 2
  • 2
1 Solution
 
SteveBayCommented:
flatListBox1.Items.Add(Name.Text);
flatListBox1.Items.Add(address.Text);
flatListBox1.Items.Add(index2.text);
0
 
gollygoodAuthor Commented:
thanks, i tried to edit my Q. But..

how do i make the lines in the listbox differnt shades or is it another component ? if so which one?
0
 
gollygoodAuthor Commented:
and how do i have the items i added to list box in a line and not listed , like..

|name|address|index|
0
 
SteveBayCommented:
You will need to set the style to lbOwnerDrawFixed and implemnt the OnDrawItem Event
Example Here:
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20828196.html

Second part:
flatListBox1.Items.Add(Name.Text + '|'+ address.Text +'|' index2.text);
0
 
senadCommented:
actually :

procedure TForm1.Button1Click(Sender: TObject);
begin
flatListBox1.Items.Add('Name.Text' + '|'+ 'address.Text' +'|' + 'index2.text');
end;
end.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now