Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Limiting selection of a checkbox in FP 2.6 styled code
Message
From
15/05/2007 21:42:11
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01225372
Message ID:
01225835
Views:
34
>Jay,
>
>Where did I say that Valid is affected by the code?

That's why I asked big guy.

>The problem is that you can set ON KEY LABEL ENTER KEYBOARD "{TAB}" CLEAR in the WHEN() of the checkbox but there's no event where you can put ON KEY LABEL ENTER to reset it. The Valid only fires when checkbox state changes. The WHEN() doesn't fire when focus is moved from checkbox to other controls using TAB key or mouse.

I've run through a bunch of scenarios on the form and it seems to work fine. Maybe these controls aren't caring so much about it, but I've not found a code path yet that's not getting run like it's supposed to.

>
>>You're saying that the Valid won't fire for the checkbox with this code the way it is? Not sure if I'm following what the practical issue is with the code. It seems to work, but I don't want to release it if there is a problem.
>>
>>>I took closer look at the problem and unfortuantely, the code is not going to work because no event is triggered when focus is moved from checkbox to other controls using TAB key or mouse. To reset ON KEY LABEL you'll have to put ON KEY LABEL ENTER in the WHEN() of every control on the form and DESTROY() of the form itself. Then checkbox WHEN() will include only
>>>ON KEY LABEL ENTER KEYBOARD "{TAB}" CLEAR
>>>
>>>
>>>>You make it seem too easy. That was a great solution. Thanks!
>>>>
>>>>>I forgot that Valid() wouldn't fire if checkbox status didn't change. Try
>>>>>
>>>>>* WHEN
>>>>>DO CASE
>>>>>CASE EMPTY(ON("KEY", "ENTER"))
>>>>>	ON KEY LABEL ENTER KEYBOARD "{TAB}" CLEAR
>>>>>CASE LASTKEY() = 13
>>>>>	ON KEY LABEL ENTER
>>>>>ENDCASE	
>>>>>...
>>>>>
>>>>>
Previous
Reply
Map
View

Click here to load this message in the networking platform