Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox behaviour in a grid
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00855772
Message ID:
00855799
Views:
17
Maybe Sparse property of the column can help?

>Hi All,
>
>I'm trying to get a customer textbox in a grid to behave as follows:
>
>(a) Return or Tab should move to the same column of the next row
>(b) Arrow keys should allow normal movement around rows and columns
>(b) The user should not be allowed to 'type their way' out of the control
>(c) The user should be able to use the mouse to move out of the control
>
>So far I have (a),(b) and (c) working (sort of) by adding a llAllowExit property to the textbox and, in the KeyPress event:
>
>IF (nKeycode=13 .OR. nKeyCode=9)
>  KEYBOARD '{DNARROW}'
>  NODEFAULT
>ENDIF
>This.llAllowExit = INLIST(nKeyCode,4,5,19,24)
>
>and then returning .F. from the Valid() when .llAllowExit=.F. The Kilofox example for moving to the next row seemed unneccessarily complicated and the above works fine in that respect. The main problem now is that when the max length of the textbox is reached the Valid() fires (and returns .F. as required) but the entire text in the box is then selected so that the next keypress deletes it all ! How can I prevent this ? I see the selection of text in the textbox is NOT controlled by it's own .SelectOnEntry property but that of the column in which it is contained - if the columns SelectOnEntry is .F. then the problem goes away but I want SelectOnEntry=.T. in normal circumstances.
>
>Also any suggestion to achieve (d) above - I may have boxed myself into a corner on that one ?
>
>Regards,
>Viv
Why do programs stop working correctly as soon as you leave the Fox?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform