Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Leaving edited textbox with a navigation key
Message
From
21/10/1997 17:42:47
Sonny Chouinard
CHCA Computer Systems Inc.
Lachenaie, Quebec, Canada
 
 
To
21/10/1997 17:17:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00055676
Message ID:
00055875
Views:
34
>>>
>>>Sonny
>>>
>>>I just got your note as I was replying to the other. What exactly did you do to solve the problem?
>>>
>>>Bob
>>
>>When you press the button on the toolbar, or use the shortcut, the valid and the lost
>>focus doesn't fire. Because, you don't change the focus on the current form. So I had
>>a cmdBox (Sounds like a patch, smells like a patch but it works). So when I fire the
>>shortcut or toolbar, I set the focus (Explicitly) on the cmdBox) so the valid and
>>lostfocus launch normally. That's the trick.
>>
>>P.S.: I don't like to patch things but this one is an exception...
>
>
>It works!
>
>I want to call the save routine from many different forms. Because I don't have any one control that I can count on always being there to set focus to, I added a cmdButton to my base FormEdit class with the name "cmdPhantom", the caption "Saving", and visible set to .f. I put it in the top left corner, out of the way.
>
>The code in my toolbar Save click event now reads:
>
>local cName
>cName=_screen.activeform.ActiveControl.Name
>_screen.activeform.cmdPhantom.visible = .t.
>_screen.activeform.cmdPhantom.Setfocus()
>_screen.activeform.cmdPhantom.visible = .f.
>_screen.activeform.save()
>_screen.activeform.&cName..SetFocus()
>
>similar code goes in my keypress routine but with "thisform" instead of "_screen.activeform".
>
>For the brief bit of time that cmdPhantom is visible, it says "Saving", then it goes away. If you don't like this, you could probably shrink it down to a very small size.
>
>Hold on - just thought of something better (and at this time untested) ... instead of a cmdButton, how about a transparent label with only a null strung in it. Should work ???
>
>Thanks to all for the great exchange. Hopefully everybody got something out of it.
>
>Bob

I put my cmdPatch in the background so no form should see it. And, I set the tabstop to off so
It won't get the focus unless I told so. Yes, you can improve that but it is a good
beginning!!!
Previous
Reply
Map
View

Click here to load this message in the networking platform