?
Solved

Obtain value from listbox

Posted on 2003-02-19
3
Medium Priority
?
232 Views
Last Modified: 2010-08-05
I have a form with a listbox (list0) that stores usernames belonging to a specified global group, using Active Directory's LDAP function.

Once I double-click an item in the listbox, I need to store the value not the index for later use. For example, the first value in list0 is "Homer Smith", I need to capture "Homer Smith" instead of 0.

Sorry, but i'm limited on points
0
Comment
Question by:wilsonjj
[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
3 Comments
 
LVL 16

Accepted Solution

by:
twalgrave earned 80 total points
ID: 7982995
if list1.listindex > -1 then
 msgbox list1.list(list1.listindex)
endif
0
 

Expert Comment

by:luisseixas
ID: 7985085
 Hi Wilson.

  Doing this, you’ll have to run through all your list items, but I guarantee you it is fast and it works very well.



procedure TForm1.List0DblClick(Sender: TObject);
var i: Integer;
begin
  For i:=0 to List0.Items.Count-1 do
    If List0.Selected[i]
      then Edit1.Text:=List0.Items.Strings[i]
end;



See ya!
0
 
LVL 3

Expert Comment

by:FaithRaven
ID: 9307475
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept twalgrave's comment
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

FaithRaven
EE Cleanup Volunteer
0

Featured Post

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.

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Progress

765 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