Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoiding bottom-scroll in grids
Message
De
23/02/2009 16:03:28
 
 
À
23/02/2009 15:10:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01383317
Message ID:
01383588
Vues:
55
Hi Rich,

To emulate a drop-down, I had set AllowCellSelect = .F. -- so the textbox's Keypress
was not firing! Moving your code to the grid's Keypress seems to work, but I'm
still checking to see if any other behaviors are affected....

-mark

---------------

>Hi Rich,
>
>Yes, I copied and pasted your code into the textbox's Keypress event in my gird class (which is a one-column grid set up to visually emulate a drop-down list. I also checked to make sure that I had not overridden that code in the test instance or anywhere in the instance's containership hierarchy.
>
>-m.
>
>=================
>
>>Worked for me in my simple test case. It also doesn't seem to work if you step through it in the debugger. (Something about RelativeRow isn't set properly, I think) Just to be sure..........did you put it in the indicated event?
>>
>>Grid.Column1.Text1.Keypress
>>
>>
>>
>>>Hi Rich,
>>>
>>>Thanks, I tried your code, but there was no change in the grid's scrolling behavior.
>>>
>>>I previously tried using OKLs to turn off the down-arrow and page-down keys when
>>>the record pointer was on the bottom record, and that made no difference, either.
>>>
>>>I'm going to play with this some more on Monday.
>>>
>>>-mark
>>>
>>>================
>>>
>>>>>The Megafox book discusses how to have the bottom of a grid fill the last page when a form is being instantiated. I would like to know the solution to a slightly different problem. If I am on the bottom displayed row of a one-column grid and that also corresponds to the last row in the record source, pressing the down-arrow or page-down key will cause a single-row scroll. The action causes me to stay at the same point in the record source and on same grid cell (as it should), but there is now a blank row at the bottom of the grid. Is there a way to prevent this? Visually, when positioned at the bottom, I want a down-arrow or page-down keypress to result in no change to my grid's appearance.
>>>>>
>>>>>TIA,
>>>>>-mark
>>>>
>>>>FWIW.........I'm not sure I would agree with this behavior. Users tend to get antsy when they press a key and nothing happens. At least the default behavior lets them know they are at the bottom of the list.
>>>>
>>>>However, you might try this.
>>>>
>>>>In Yourgrid.Column1.Text1.Keypress.........
>>>>
>>>>LPARAMETERS nKeyCode, nShiftAltCtrl
>>>>IF INLIST(nKeyCode,24,3)
>>>>   SKIP
>>>>   IF EOF()
>>>>      GO BOTT
>>>>      IF this.Parent.Parent.RelativeRow = this.Parent.Parent.GridLines
>>>>            NODEFAULT
>>>>      ENDIF
>>>>   ELSE
>>>>      SKIP -1
>>>>   ENDIF
>>>>ENDIF
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform