﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum / StrataFrame Application Framework / WinForms (How do I?)  / Ability to setup hotkeys.... / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>forum@strataframe.net</webMaster><lastBuildDate>Mon, 13 Oct 2008 08:09:55 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Ability to setup hotkeys....</title><link>http://forum.strataframe.net/Topic16129-7-1.aspx</link><description>The easiest thing to do here is to override the ProcessCmd method and insert your override logic.  This is something that we commonly do to add hotkey functionality...and this is the root level so it will trump anything else.&lt;/P&gt;&lt;P&gt;This is a method on any control, so you could either inherit the MaintenanceFormToolstrip and add it there...or if this is more of a one time thing then you could just do it in the form.  In either case, the code would be the same:&lt;/P&gt;&lt;P&gt;[codesnippet]Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean&lt;BR&gt;Select Case keyData&lt;BR&gt;    Case Keys.Alt Or Keys.N&lt;BR&gt; '-- It is always a good idea to supply a result in the message&lt;BR&gt;        msg.Result = IntPtr.Zero&lt;BR&gt; &lt;BR&gt; '-- Perform your logic&lt;BR&gt;        ' TODO&lt;/P&gt;&lt;P&gt; '-- Return out of the method&lt;BR&gt;        Return True&lt;/P&gt;&lt;P&gt;End Select&lt;/P&gt;&lt;P&gt;'-- Perform the default logic here&lt;BR&gt;Return MyBase.ProcessCmdKey(msg, keyData)&lt;BR&gt;End Function[/codesnippet]</description><pubDate>Mon, 05 May 2008 09:45:30 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>Ability to setup hotkeys....</title><link>http://forum.strataframe.net/Topic16129-7-1.aspx</link><description>Is there a way that I could setup a hotkey so that when a user presses ALT-N? Like a hotkey I could bind to the New button on the MaintenanceToolstrip?</description><pubDate>Mon, 05 May 2008 08:19:52 GMT</pubDate><dc:creator>StarkMike</dc:creator></item></channel></rss>