Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On Key Label query

Status
Not open for further replies.

DarrenWard

IS-IT--Management
Feb 15, 2002
217
GB
I want to use my function keys within my program, but I cannot get to the F10 key.

If I press it I get Creates, Opens, Saves prints files or quits foxpro' at the bottom of the screen.

I have tried issuing a 'On Key Label F10' but it does not work.

Dazz (Like Harry Potter's schooling, I can't do anything without a spell checker)
 
HI
Issue a PUSH KEY CLEAR command before your current key assignments. Then define your keys. After the requirement is over, issue the POP KEY to get back the old set of ON KEY LABEL assignments.

Hope this solves your problem :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
I tried to issue a 'Push Key Clear' with and without a 'On Key Label F10' and it does not work.

I still get the 'Creates, opens, saves, prints files or quits Visual FoxPro' at the bottom of the screen.

And when I press the F5 key nothing happens at all.

Dazz (Like Harry Potter's schooling, I can't do anything without a spell checker)
 
Dazz,
I just tried:
ON KEY LABEL f10 MESSAGEBOX("F10")
in VFP 5.0a SP3, VFP 6.0 SP5, and VFP 7.0 SP1, it works.
I also tried:
ON KEY LABEL f10 Wait Window "F10"
in FPW and FPD 2.6a, and that works.

Can you give us more information on what you tried, and what doesn't seem to work?

Rick
 
The reason you're getting "Creates, opens, saves, prints files or quits Visual FoxPro" when you press F10 is because F10 is a Windows standard key that activates the system menu. Try it in any program. :eek:)

That being said, I can't imagine why the ON KEY LABEL command isn't working for you. I tried Rick's examples and they worked fine for me as well. Try them in the command window and see if they work for you there.

Ian
 
Thanx so far guys,

I have a form set, on the contained forms I have the keypreview set to .t. So when I press F keys I want stuff to happen.

If I put a on 'key label F10 messagebox("F10")' in the form set init event it pops up with the box fine. But if I put a 'key label F10' in it does the menu thing. I can't seem to get the form to see the F10 key.

I s'pose I could just 'key label F10 (do what I want it to do)' instead of making the form keypreview take care of it.

Dazz
(Like Harry Potter's schooling, I can't do anything without a spell checker)
 
What is your code that you are using to process the key? I assume it's in your FormSet's KeyPress event? Can you paste it in here?
 
Cheers chpicker i've got it doing what I want it to.

The way that the whole thing hangs together is confusing me at the moment, it's a diferent concept to VB.

For example, I have a program that set a few thing up (date = british and all that) and then just does a 'Do Form frmMenu'

frmMenu can then be used to call various FormSets using 'Do Form Customer'

From there I can search my accounts/manufacturing system (written in FoxPro, hence my current migration from VB to VFP) and search on customers, sales orders, quotes etc.

But then when I want to close down that form and return to the menu I get funny stuff. The help file says that .Release can be used to close down a form or formset but if I use it on the formset it tell me no such object.

If I use close all, or clear all it closes down the formset, but when I exit the program and try and modify the formset it tells me that the formset is still open, but doing a clear all from the command box clears it down.

Its all just doing me head in at the moment, I need to go off and do a quick coarse or something, but noone seems to offer anything around here.

Maybe it's just the new tricks and old dogs thing.....

Dazz (Like Harry Potter's schooling, I can't do anything without a spell checker)
 
To close your formset, issue this command:
Code:
ThisFormSet.Release()
The reason you'rebeing told that the formset is still open is that it still is. All of the forms in it may have been closed, but the formset itself (which is invisible) is still there. Using the above line will take care of this.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top