﻿<?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 - V1 » WinForms (How do I?)  » Ability to setup hotkeys....</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 00:17:37 GMT</lastBuildDate><ttl>20</ttl><item><title>Ability to setup hotkeys....</title><link>http://forum.strataframe.net/FindPost16129.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 09:45:30 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Ability to setup hotkeys....</title><link>http://forum.strataframe.net/FindPost16133.aspx</link><description>The easiest thing to do here is to override the ProcessCmd method and insert your override logic.&amp;nbsp; 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.&amp;nbsp; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case Keys.Alt Or Keys.N&lt;BR&gt;&amp;nbsp;'-- It is always a good idea to supply a result in the message&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg.Result = IntPtr.Zero&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;'-- Perform your logic&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' TODO&lt;/P&gt;&lt;P&gt;&amp;nbsp;'-- Return out of the method&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 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></channel></rss>