Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ListBox Question For The Experts

Posted on 1998-12-07
10
Medium Priority
?
170 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

610 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