Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
On key label puzzler
Message
From
23/08/1999 09:37:08
Kenneth Downs
Secure Data Software, Inc.
New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00256086
Message ID:
00256547
Views:
28
James,

As Fred mentions, VFP doesn't really want you to use ON KEY LABEL.

My own tastes run to putting these functions onto the menu and using menu shortcuts, whose enabled/disabled properties are much easier to control. You would then have a menu bar something like:
DEFINE BAR GoUp OF MyEditMenu PROMPT "Go UP";
  KEY pgup,"PgUp";
  SKIP FOR TYPE("_Screen.ActiveForm.FlagThisFormDoesUpAndDown") = "U"
ON BAR BoUP of MyEditMenu _Screen.ActiveForm.GoUp
Notice that forms that support the UP/DOWN keys would have a property defined "FlagThisFormDoesUpAndDown," while forms that do not support it would not. Once you've done this in your classes, you get the behavior for free throughout your app.

>I am using the ON KEY LABEL to "bind" the up and down arrows to move around a table. I have created two procedures, GO UP and GO DOWN so the user can scroll up and down if they are are the grid or not.
>The form name is searchsub.
>Here's the problem, this works when running in VFP but when I compile the APP and run it from a program I get an error.
>(OBJECT searchsub is not found)
>
>The error happens when you are on the form.
>
>Here's the code:
>ON KEY LABEL UPARROW searchsub.GOUP
>
>Am I doing this completely wrong?
>How do I do this?
>
>Thanks,
>
>Jim
Previous
Reply
Map
View

Click here to load this message in the networking platform