[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

adding to a listbox

Posted on 2010-01-07
6
Medium Priority
?
336 Views
Last Modified: 2013-11-23
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
Comment
Question by:gollygood
  • 2
  • 2
5 Comments
 
LVL 14

Expert Comment

by:SteveBay
ID: 26204400
flatListBox1.Items.Add(Name.Text);
flatListBox1.Items.Add(address.Text);
flatListBox1.Items.Add(index2.text);
0
 

Author Comment

by:gollygood
ID: 26204413
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
 

Author Comment

by:gollygood
ID: 26204427
and how do i have the items i added to list box in a line and not listed , like..

|name|address|index|
0
 
LVL 14

Accepted Solution

by:
SteveBay earned 2000 total points
ID: 26204500
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
 
LVL 22

Expert Comment

by:senad
ID: 26207645
actually :

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question