Re: Keypress event F2 works in VFP6 but not VFP7 onwards
- From: "Dan Freeman" <spam@xxxxxxxxxxxxx>
- Date: Thu, 18 Aug 2005 09:19:51 -0700
You didn't test it in the runtime. It works fine for me.
Build an exe and run that exe from Windows Explorer to test.
F2 is pre-assigned ONLY IN THE IDE. No matter what you do, by the time you
get around to doing it the keystroke has already been assigned IN THE IDE.
That assignment doesn't happen in runtime.
Dan
John Roberts wrote:
> It appears that F2 keypress functionality has been lost irrelevant of
> whether there is a menu with _MEDIT pad on it or not.
> I have built a menu as an experiment without the _MEDIT pad and F2
> still does not return -1 in the keypress event.
> What I have discovered is that if you have a menu built around the
> _MSYSMENU that has any of FoxPros owns pad menus e.g.
> _MFILE, _MWINDOW etc then F2 is disabled as a keypress event. This
> includes menus built with the "QuickMenu" option as suggested.
>
> I have attached a simple form example of the problem. Run the Form
> press F2 nothing happens, press F3 and it works.
>
> This, I would suggest, is a bug.
>
> Thanks for your help.
> John R.
>
> "Fred Taylor" <ftaylor@xxxxxxxx!REMOVE> wrote in message
> news:eLzJZzzoFHA.3960@xxxxxxxxxxxxxxxxxxxxxxx
>> It would be easier to build a new QuickMenu with everything in it and
>> remove
>> what you don't want from it in the code, rather than trying to
>> remove from the standard menu at runtime.
>>
>> --
>> Fred
>> Microsoft Visual FoxPro MVP
>>
>>
>> "John Roberts" <JohnRoberts@xxxxxxxxxxxxx> wrote in message
>> news:dduuul$1u7$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>> Thank you for your reply (Fred).
>>> In my application we are still including the _MEDIT menu pad.
>>> i.e. set sysmenu to _MEDIT, _MWINDOW
>>> and then other of our own menus added to this via PRG code.
>>>
>>> Then options are removed from the _MEDIT menu e.g.
>>> RELEASE BAR _MED_SP300 OF _MEDIT
>>> RELEASE BAR _MED_FIND OF _MEDIT
>>> RELEASE BAR _MED_REPL OF _MEDIT
>>> RELEASE BAR _MED_FINDA OF _MEDIT
>>> RELEASE BAR _MED_REPLA OF _MEDIT
>>> RELEASE BAR _MED_SP400 OF _MEDIT
>>> RELEASE BAR _MED_LISTMEMBERS OF _MEDIT
>>> RELEASE BAR _MED_QUICKINFO OF _MEDIT
>>> RELEASE BAR _MED_SP500 OF _MEDIT
>>> RELEASE BAR _MED_BKMKS OF _MEDIT
>>> RELEASE BAR _MED_SP600 OF _MEDIT
>>> RELEASE BAR _MED_INSOB OF _MEDIT
>>> RELEASE BAR _MED_OBJ OF _MEDIT
>>> RELEASE BAR _MED_LINK OF _MEDIT
>>> RELEASE BAR _MED_SP700 OF _MEDIT
>>> RELEASE BAR _MED_PREF OF _MEDIT
>>>
>>> However, it appears that not all menu items get removed as per the
>>> commands above.
>>> I get the errors with the above commands "Variable '_MED_SP600' is
>>> not found." and "Variable '_MED_SP700' is not found."
>>> When I remove the lines with _MED_SP600 and _MED_SP700, I get
>>> these two lines in the menu.
>>> However the bigger issue is that the "BookMarks" options still
>>> appear and are not removed whether the above error lines are in the
>>> code or not.
>>>
>>> So my question. How can I remove the "BookMarks" from the system
>>> _MEDIT menu so that I can regain control of the F2 key.
>>> I would rather do this than build a custom _MEDIT menu with a new
>>> name as the _MEDIT menu it integral to other code in the
>>> system and would rather use that than do more re-writing to make it
>>> work in VFP9.
>>>
>>> Thanks
>>> John R.
>>>
>>> "Fred Taylor" <ftaylor@xxxxxxxx!REMOVE> wrote in message
>>> news:eJ5taItoFHA.572@xxxxxxxxxxxxxxxxxxxxxxx
>>>> It will work as long as the standard menu is not available. F2 is
>>>> used for Next Shortcut/Bookmark in VFP7 and above. (under menu
>>>> Edit/Bookmarks)
>>>>
>>>> --
>>>> Fred
>>>> Microsoft Visual FoxPro MVP
>>>>
>>>>
>>>> "John Roberts" <JohnRoberts@xxxxxxxxxxxxx> wrote in message
>>>> news:ddu0hr$qcf$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>> I am converting an application from VFP6 to VFP9 and have
>>>>> discovered an issue that I hope someone can help with.
>>>>>
>>>>> I am trying to capture the F2 key being pressed within a textbox
>>>>> on a form
>>>>> in the keypress event (nKeyCode=-1). This would not work in VFP9
>>>>> so after
>>>>> trying many things I built a basic form with one text control and
>>>>> a capture
>>>>> of the key press events to screen. It appears that in VFP6 the
>>>>> textbox keypress event happily tells me that F2 has been pressed,
>>>>> however in VFP7
>>>>> onwards it appears that the F2 is not captured and nothing
>>>>> happens. The ON
>>>>> KEY LABEL is not active and F3, F4 etc are all working e.g.
>>>>> nKeyCode=-2,
>>>>> nKeyCode=-3 etc. This happens only with F2 (nKeyCode=-1).
>>>>>
>>>>> Does anyone know why? Is there something I am missing?
>>>>> This seems too simple an issue to be a bug?
>>>>>
>>>>> Thanks
>>>>> John R.
.
- Follow-Ups:
- Re: Keypress event F2 works in VFP6 but not VFP7 onwards
- From: John Roberts
- Re: Keypress event F2 works in VFP6 but not VFP7 onwards
- References:
- Keypress event F2 works in VFP6 but not VFP7 onwards
- From: John Roberts
- Re: Keypress event F2 works in VFP6 but not VFP7 onwards
- From: Fred Taylor
- Re: Keypress event F2 works in VFP6 but not VFP7 onwards
- From: John Roberts
- Re: Keypress event F2 works in VFP6 but not VFP7 onwards
- From: Fred Taylor
- Keypress event F2 works in VFP6 but not VFP7 onwards
- Prev by Date: Re: Migration from XBase++ to Visual FoxPro 9
- Next by Date: Re: Change colors of the Window Globaly ?
- Previous by thread: Re: Keypress event F2 works in VFP6 but not VFP7 onwards
- Next by thread: Re: Keypress event F2 works in VFP6 but not VFP7 onwards
- Index(es):
Relevant Pages
|
Loading