How to simulate On F12 Anywhere in .NET Form

Posted by DRidnouer on 13-Oct-2010 11:17

All of our windows have a trigger of "ON 'F12':U ANYWHERE DO" to display an about dialog box.  How can I do the same thing on a GUI for .NET form?

Thanks,

Dave

All Replies

Posted by Roger Blanchard on 13-Oct-2010 11:23

We use the KeyUp event on grids and the use code similar to the following. I checked a form and it also has the same KeyUp event.

IF Progress.Util.EnumHelper:AreEqual(e:KEYCODE, System.Windows.Forms.Keys:Return) THEN

Roger Blanchard

Osprey Retail Systems, Inc.

404 County St.

New Bedford, MA 02740

Phone: (508) 992-1097

Fax: (508) 992-2716

Posted by Admin on 13-Oct-2010 12:03

The simples would be an Menu/Tooltip/Ribbon Button with F12 as a Shortcut key.

An alternative would be to set the KeyPreview property of the Form to True and subscribe the KeyPress, KeyDown or KeyUp events on the Form. See http://msdn.microsoft.com/en-us/library/system.windows.forms.form.keypreview(v=VS.80).aspx

Posted by DRidnouer on 13-Oct-2010 13:18

Thanks, I was able to set the KeyPreview property to true and then use the KeyDown event.

This thread is closed