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!

cell focus in grid

Status
Not open for further replies.

dpboss

Programmer
Jul 15, 2003
3
US
Hello .. I have a question on a simple problem.

VFP 6.0
I have a grid on a form populated with employee name and
addresses.
Also on the form I have a text box that has focus where I do
a seek as I type the employee name to search..
The grid jumps down to the area where the name matches as I
type, fine
What I want to do is change the color of the grid cell where
the name gets focus changed to a different color, or set the
fontbold to .t. so the user can see exactly where on the
grid their typing is taking them.
Is this possible to do with grid elements? I can change the
fontbold for the entire grid but not for individual cells.
ie. "thisform.employee.column1.text1.fontbold = .t."

Thanks, foxproboss
 
foxproboss

probably the quickest and easiest solution is to use the grid.setall.dynamicbackcolor, to highlight the entire row selected in a different color. There was a very recent thread about this very same subject.






WTrueman
...if it works dont mess with it
 
You can insert this code, this will change all matching records to yellow. You can play around with the RGB Color settings to get the one you need. Change the thisform.text1.value to your textbox and database.element to the matching database field.




Thisform.grid1.SetAll("DynamicBackColor", ;
"IIF(thisform.text1.value=database.element, RGB(247,251,189) , RGB(255,255,255))", "Column")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top