Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Little Annoying behaviour
Message
From
06/02/2004 02:20:46
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00874203
Message ID:
00874718
Views:
17
Try putting this in your grid's refresh method...

*IF ALL ROWS CAN FIT IN THE GRID, THEN REFRESH SO YOU CAN SEE ALL RECORDS
LOCAL ScrnLocked
ScrnLocked = THISFORM.LOCKSCREEN

IF NOT ScrnLocked
THISFORM.LOCKSCREEN=.T.
ENDIF
WITH THIS
SELECT (.RECORDSOURCE)
STORE RECNO() TO lnRecno
IF RECCOUNT()< FLOOR((.HEIGHT-.HEADERHEIGHT-IIF(BITAND(.SCROLLBARS,1)=1, SYSMETRIC(8), 0))/.ROWHEIGHT)
GO TOP
DODEFAULT()
ENDIF
ENDWITH
LOCATE RECORD (lnRecno)
DODEFAULT()
IF NOT ScrnLocked
THISFORM.LOCKSCREEN=.F.
ENDIF

>Hello Folks,
>
>I have a grid which is used as list box or read only implmented originally in VFP 6.0 to highlight the selected record using the IIF with dynamic and foreground colors set for selected record in the Init of the Grid, I need to highlight the last record as opposed to the first one upon launching the form.
>
>First time I launch the form with 5 or so records (Grid display area not full), it highlights the last record and all other records are shown, the way I want it.
>
>Successive lanuches would show only the last record with the scroll bar on which you you have to click to show all previous records.
>
>I use ActivateCell to activate the last record and the grid in a form based class object which is instantiated to an object under _screen object. I use VFP 8.0 under Windows XP.
>
>Any solution for this inconsistent behaviour?
>
>Many thanks!
L.A.Long
ProgRes
lalong1@charter.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform