?
Solved

ListBox Question For The Experts

Posted on 1998-12-07
10
Medium Priority
?
169 Views
Last Modified: 2010-04-04
I have tvo listbox when i click any item in the listbox1 then i will the listbox2 item moves to the itemindex of listbox1 ( the blue arround it )and one question ( what is the "values" and "Name" properties of this component? how can i use them..Thanks.....
0
Comment
Question by:emiltor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 200 total points
ID: 1349758
The name property is the componet name (eg: ListBox1). There is not property "values" in the TlistBox component, I assume you mean "items".

Items is the list of entries in the list box. To add some items you can do this:

listBox1.items.add('Item 1');
listBox1.items.add('Item 2');
listBox1.items.add('Item 3');

Cheers,

Raymond.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1349759
hi emiltor,

first:

procedure TForm1.ListBox1Click(Sender: TObject);
begin
  Listbox2.ItemIndex := listbox1.ItemIndex;
end;

second

  There is no value property
  Name is the property where you can name the component

meikl

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1349760
hi emiltor,

the items in listbox contains the property values

you can use this, when the entries in the listbox in the following format

xy=z

with

with listbox1.items.values['xy'] you can retrieve the z

sample

  edit1.text :=  listbox1.items.values['xy'];

meikl
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:viktornet
ID: 1349761
YOu can use this..

OnClick()

ListBox2.ItemIndex := ListBox1.ItemIndex;

or if the same string is in a different line then you can use something like this...

ListBox2.ItemIndex := ListBox2.IndexOf(ListBox1.Items.Strings[ListBox1.ItemIndex]);

Hope this helps...

Cheers,
Viktor
0
 

Author Comment

by:emiltor
ID: 1349762
Adjusted points to 50
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1349763
hi emiltor,

are you sure that your accepted answer reflects your question?

meikl
0
 

Author Comment

by:emiltor
ID: 1349764
Yes..... Victornet have it
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1349765
Oh .. really?

i think rwilson have it

meikl
0
 

Author Comment

by:emiltor
ID: 1349766
RWilson have the answer for "Values" question And Name but not the other question

Like move the blue arround the text in listbox2 on listbox1.itemindex
Viktornet have the answer for that...


0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1349767
as you mean
its your thread

meikl

0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month12 days, 20 hours left to enroll

777 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