Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Graham Trott
  Where is Graham Trott?
 Hamilton
 Canada
 Graham Trott
 To: Ammar Hadi
  Where is Ammar Hadi?
 Al-Samawah
 Iraq
 Ammar Hadi
 Tags
Subject: RE: Keyboard Redirection
Thread ID: 228284 Message ID: 228583 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Wednesday, May 20, 2009 4:07:19 AM         
   


As always thank you everyone. What I was attempting to accomplish had to do with a table of filenames and an associated person. When I needed to find an old file from that person, I would select the particular file from this table and check for it's existence. This table is small, only about five hundred records. If the file wasn't found (moved or whatever) then I was trying to feed the fullname back to a master table that contained all the files in this project (about 80000 records) and do a search for the file and if found open the file and also change the record in the smaller file to match the proper location. I can pass the data back to the search field, but when I add the enter key (chr(13)) it pulls up the wrong record. I think it has something to do with the delay in opening the file. For now I have decided to drop back to the master table (form1 in a forset) and require the user to press the verify the data and then press the enter key. The idea was to be able to open multiple files from the smaller table (form 4 of the formset) and it works fine until it finds a file that has been moved. It also may have something to do with the programaticchange event which I never thought of until writing this reply. Oh well back to the grind.

And as always thank you to the people that really know VFP inside and out. I came from a clipper background (no gui - the simple interfaces but the much more complicated programming) and before that I actually taught DBase III programming. I've been using VFP for about three years and the things you can do compared to the old ways are simply amazing. I'm still very much a learner in this forum.

> > Back to my favorite forum. Is it possible to send a keystroke from one event in a formset to another event in the same formset (different form).
>
> Hi Graham,
>
> your request is not so clear. I will suppose 2 Scenarios and you choose which fits into your request.
>
> 1) The keystroke is received normally in the keypress event of the object that has that event. (and if you have keypreview property of the form set to .t., you will receive it in the form before the contained objects). From there you can pass the code of the char like this:
>
>
> * keypress event (in form1)
> LPARAMETERS nKeyCode, nShiftAltCtrl
> 
> thisformset.form2.yourobject.yourevent(nKeyCode)
> 
> ** in yourevent, you should have a parameters command
> PARAMETERS lnRecievedKeyCode
> 
> * do what you need with the code
> 

>
> 2) In this scenario you can pass the key stroke as a key stroke like this:
>
>
> * keypress event (in form1)
> LPARAMETERS nKeyCode, nShiftAltCtrl
> 
> WITH Thisformset.form2
>  .Show()
>  .activate
>  .text1.setfocus
> ENDWITH
> 
> KEYBOARD CHR(nKeyCode) CLEAR
> 
> NODEFAULT
> 

>
> In this case the key you press will appear in the textbox of the second form.
> If you remove NODEFAULT, you will get the pressed key in both forms.
>
> Hope this helps
>
> Ammar Hadi ................IRAQ
>
> My Foxite Weblog
>
> ---------------
> I I I really love foxite
> ___________________________

ENTIRE THREAD

Keyboard Redirection Posted by Graham Trott @ 5/17/2009 11:09:27 PM
RE: Keyboard Redirection Posted by Ammar Hadi @ 5/17/2009 11:37:41 PM
RE: Keyboard Redirection Posted by Graham Trott @ 5/20/2009 4:07:19 AM
RE: Keyboard Redirection Posted by Jun Tangunan @ 5/18/2009 1:37:33 AM
RE: Keyboard Redirection Posted by tushar @ 5/18/2009 7:49:19 AM