Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP 7 listbox row appears selected after going to another object. 2

Status
Not open for further replies.

bettyfurr

Technical User
Mar 12, 2002
371
US
I have 2 list boxes. When I select 1 row in the first listbox, use the data, select the 2nd listbox to use the data, both list boxes have a highlighted row. (The record in the list box stays highlighted after going to any other type of object, also.)

I am getting the correct results, however it is confusing on the screen.

These listbox are populated with a SQL statement using into cursor ilist1 and ilist2.

 
Use this in the lostfocus:

This.selected(1)=.F.

That should do it for you.

CrossTec
 
What I do is change the color of the highlight. In the LostFocus event of the ListBox:
[tt]
* Change to light grey
this.SelectedItemBackColor=rgb(128,128,128)
[/tt]
Then, in the GotFocus event:
[tt]
* Change to dark blue
this.SelectedItemBackColor=RGB(0,0,128)
[/tt]
Alternately, instead of specifying the color, you can use the class default instead in the GotFocus event:
[tt]
* Reset color back to inherited default
this.ResetToDefault("SelectedItemBackColor")
[/tt]
Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top