Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: Frank Smith
  Where is Frank Smith?
 Houston
 Texas - United States
 Frank Smith
 Tags
Subject: RE: ListBox help needed
Thread ID: 331329 Message ID: 331330 # Views: 79 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Thursday, December 29, 2011 1:33:31 AM         
   


> Ok, been away from VFP for a while.
>
> Have a ListBox with a source of "members.dbf"
> In another area of code I locate a record in members and issue a List1.Click()
> The Click() does what it is supposed to do BUT
> the chosen record in the ListBox is not highlighted... can be confusing
> to the User.
>
> how do I get the chosen record in the listbox to highlight?


You have to properly position its listindex as well:

Local lcDataToFind, lnloop
lcDataToFind = "Whatever"
Thisform.list1.ListIndex = 1
For lnloop = 1 To Thisform.list1.ListCount
    Thisform.list1.ListIndex = m.lnloop
    If Alltrim(Thisform.list1.ListItem(m.lnloop)) = m.lcDataToFind
        thisform.list1.Click()
        Exit
    Endif
Endfor


http://sandstorm36.blogspot.com
http://weblogs.foxite.com/sandstorm36/default.aspx

ENTIRE THREAD

ListBox help needed Posted by Frank Smith @ 12/29/2011 1:07:08 AM
RE: ListBox help needed Posted by Jun Tangunan @ 12/29/2011 1:33:31 AM
RE: ListBox help needed Posted by Stefan Wuebbe @ 12/29/2011 8:49:20 AM
RE: ListBox help needed Posted by Frank Smith @ 1/18/2012 3:54:50 PM
RE: ListBox help needed Posted by Anders Altberg @ 1/18/2012 6:59:02 PM
RE: ListBox help needed Posted by tushar @ 1/19/2012 5:45:10 AM