Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlight text in a grid cell
Message
From
24/06/2002 19:28:22
 
 
To
24/06/2002 11:03:04
Denis Filer
University of Oxford
United Kingdom
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00671643
Message ID:
00671866
Views:
21
Hi Denis,

The nRow and nColumn parameters are relative to the visible portion of the grid and have nothing to do with its ControlSource. You can Activate a cell not in the grid's visible display area. If I understand correctly what you are after I assume that the process of finding the value has already positioned you on the correct record in the grid's RecordSource.

Calling the grid's Refresh method will put that row in the visible portion of the grid's display. Then use the column's SetFocus() method to put the highlight on the correct cell.

So...
** Execute the code to find the recno() and column in the RecordSource
GO lnRecordNumberWithFoundValue
Grid.Refresh()
Grid.Columns(lnColumnContainingValue).SetFocus()

HTH

Pamela

>Ive added a Find function to a form with a grid, attempting to partially emulate the wonderful Browse Ctrl+F find. Having located the correct grid cell, Im having all sorts of trouble highlighting or selecting this cell so the user sees the find result. I have setfocus to the grid, tried to activate the cell using row and column and select the text. Any clues much appreciated.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform