Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid w/ ComboBox Navigation Problem
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00484639
Message ID:
00484642
Views:
11
>I have a ComboBox as a column in a Grid. What I would like to be able to do is navigate up or down the grid using the arrow keys. The default behavior is that input from these keys causes the focus to remain on the same row and instead changes the selected item in list for the ComboBox. I believe this is due to internal VFP programming associated with this control. But this use of the arrow keys is inconsistant with other controls placed in a grid (e.g. TextBoxes), and, IMHO, it's simply not what is expected by the typical user.
>
>Can anyone provide me with code to achieve this desired effect.
>
>Note that I have tried using the following code in the KeyPress event of the ComboBox, but it doesn't quite work (it allows movement to the next or previous row but still changes the ComboBox value in the newly visited row.)
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>* This only fires for the up arrow key (=5) or down arrow key (=24)
>IF (nKeyCode = 5 AND NOT bof()) OR (nKeyCode = 24 AND NOT eof())
> lnSkip = iif(nKeyCode = 5, -1, 1)
> WITH this.Parent.Parent
> .ActivateCell(.ActiveRow + lnSkip, .ActiveColumn)
> ENDWITH
>ENDIF
>
>There was a separate posting about this very same topic by David Thome a couple days ago in the VFP 7.0 Category. But only one reply came from his posting and it didn't provide a clear solution. Plus I thought I'd post mine in this category because this problem is general to the Grid of all VFP releases.

Try adding a NODEFAULT to your above code.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform