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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menus in VFP9. Access Keys

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
621
GB
I am creating a menu (.mnx) in VFP9 - have not used them seriously before. Am finding that that a prompt containing \< - e.g. \<File is not showing the F as underlined when I run the menu; However if I then key in Alt-F this has the expected effect : It invokes the File action.

Have I got some option set up wrong? I had understood that specifying a menu prompt with this string included would cause the next character to be underlined when the menu is displayed.
 
You need to be setting the desired Shortcut Options (in OPTIONS) at the individual menu item that you want.

Have you looked at the free on-line VFP video named:
Creating System Menus
at:
If not you might want to spend some time looking at it.

Good Luck,
JRB-Bldr
 
Andrew,

What you are seeing is normal. Depending on the version of Windows, the underlining does not necessarily show up all the time. You need to press the Alt key to make the underlines visible. This does not affect the actual functioning of the key.

JRB-Bldr,

This has got nothing to do with shortcut keys. What Andrew is trying to do is to assign an accelerator, which is different from a shortcut. He does't need to sit through a lengthy video to figure this out (no reflection on quality the Garfield's tutorials, of course).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thanks for that, Jrb. Have looked at the video. He has a pleasant style, although the particular point of underlining the accelerator keys is not covered. I have not been able to find any setting in the OPTIONS for the menu item which causes the underline to be displayed,

Thanks also, Mike.

I have investigated a little further.

On my menu the underlines on the menu bar do not show, but the Alt key has the desired effect. On the 2nd level – the drop-down menu pads (if that is the right description) they do show.

The Alt key has the effect of toggling between highlighting and unhighlighting a menu selection (e.g. File) so that you can navigate along the menu..

On the Pegasus OPERA package (written in VFP), the underlines do not initially show, but pressing the Alt key switches on underlines perrmanently and then cycles between highlighting and unhighlighting the first menu item.

On Microsoft Outlook 2003 (not a VFP application so far as I know) the menu starts and remains with underlines on. The Alt key again has the effect of toggling the highlight of the first selection on and off.

I would like to achieve the effect that Outlook and Pegasus achieve (of having the underline shown on the menu). But maybe I need to move towards using a Toolbar approach . . .
 
Andrew,

I can confirm your observations. I don't have Pegasus, but other applications are broadly in line with what you describe.

I wouldn't suggest that you abandon menus and move to toolbars merely to solve this poblem. Personally, I don't often use drop-down menus these days. But if you've already created menus, I wouldn't worry about the lack of underlining. Most users probably won't even know it's an issue.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
There's a trick, colleagues, that had been shown to me by one of my colleagues on another VFP forum. Here it is:

Code:
LOCAL loShell

oShell = CreateObject("WScript.Shell")
oShell.SendKeys("%")
oShell.SendKeys("%")
RELEASE oShell

It did work on WinNT 5.01 (a.k.a. WinXP), but does not seem to be working as well on WinNT 6.01 (a.k.a. Win7, 32-bit in my case).

Nevertheless, it worth a try, don't you think?

Regards,

Ilya
 
Ilya,

If I've understood it right, what you are suggesting is to programmatically fire the Alt key at the start of the program, so that it makes the underlining visible.

I'm not sure why that would work. As you say, it doesn't seem to work in XP. What I'm seeing is the first menu item being momentarily highlighted and then returning to normal, with no underlining visible. If you just send the key once, the menu item remains highlighted and active, but still without underlining. I haven't tried it in later versions.

Still, it's worth keeping in mind. Personally, I wouldn't bother with any of this, but it's an interesting idea.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Actually, Mike, it did wok on XP.
It's Win7 32 bit machine that this thing does not work.

Regards,

Ilya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top