Solved

ListBox Question For The Experts

Posted on 1998-12-07
10
161 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
10 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 50 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now