﻿<?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?)  » Keyboard Short-Cuts</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 05:49:53 GMT</lastBuildDate><ttl>20</ttl><item><title>Keyboard Short-Cuts</title><link>http://forum.strataframe.net/FindPost23579.aspx</link><description>We have several clients that heavily use keyboard short-cuts and they noticed that they are missing from key areas of Strataframe controls. In particular, the Maintenance Toolstrip lacks even the common Ctrl-S to save let alone navigation short-cuts. The BrowseDialog doesn’t have any accelerator keys to get from the search area to the list and then to Ok and Cancel quickly, without a mouse. &lt;br&gt;
&lt;br&gt;
I know that I could add them myself but it would improve the "out of the box" experience of StrataFrame if I didn't have too. Is there a reason you didn't include them (localization or something)? Or, am I just missing the global “TurnOnKeybordShortCuts=True” property?&lt;br&gt;</description><pubDate>Fri, 19 Jun 2009 08:24:51 GMT</pubDate><dc:creator>Scott Bressette</dc:creator></item><item><title>RE: Keyboard Short-Cuts</title><link>http://forum.strataframe.net/FindPost23601.aspx</link><description>That is a great answer Greg...and totally correct! :D  Not that you were ever doubted!&lt;br&gt;
&lt;br&gt;
Just to add one thing in regards to the BrowseDialog.  You have pretty much total control over this as well.  You can set the shortcut keys for the AcceptKey, CancelKey, and SearchKey.  But you can also force the focus to the results after a query is performed by setting the SetFocusToResultsAfterSearch property to True.  Then after that it is just a matter of user the arrow keys to find the record and a Ctrl+Enter (by default) to accept the selected row.</description><pubDate>Fri, 19 Jun 2009 08:24:51 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Keyboard Short-Cuts</title><link>http://forum.strataframe.net/FindPost23597.aspx</link><description>Exactly! :D</description><pubDate>Thu, 18 Jun 2009 17:58:27 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Keyboard Short-Cuts</title><link>http://forum.strataframe.net/FindPost23592.aspx</link><description>Greg, &lt;br&gt;
&lt;br&gt;
That's an excellent answer. I'll do that in my base form. That way, it work regardless of what save option I am providing.&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
Scott</description><pubDate>Thu, 18 Jun 2009 12:07:04 GMT</pubDate><dc:creator>Scott Bressette</dc:creator></item><item><title>RE: Keyboard Short-Cuts</title><link>http://forum.strataframe.net/FindPost23586.aspx</link><description>I agree that this would be a nice enhancement.  However, note that for the maintenance form toolstrip, it wouldn't actually be added there, but rather at the form level. Why? Because if the toolstrip handled the shortcuts, they would only work if the toolstrip was receiving the key presses. I.e. if the user was in a text box and hit the keyboard shortcut, the maintenance form toolstrip wouldn't know about it.  However, key presses bubble up to parent controls, so if you handled the shortcut at the form level, it would work great.&lt;br&gt;
&lt;br&gt;
It is easy to implement though.  Typically, you override the ProcessCmdKey method on the form. Then you'd use a select case (switch in C#) statement to test for the various keys and then call whatever methods. The following would implement save and new short cuts:&lt;br&gt;
&lt;br&gt;
[codesnippet]Protected Overrides Sub ProcessCmdKey(msg As System.Windows.Forms.Message _&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;, keyData As System.Windows.Forms.Keys)&lt;br&gt;
&amp;nbsp;&amp;nbsp;'-- Track if the key is handled here&lt;br&gt;
&amp;nbsp;&amp;nbsp;Dim keyHandled As Boolean = False&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;'-- Handle any configured keyboard shortcuts&lt;br&gt;
&amp;nbsp;&amp;nbsp;'&amp;nbsp;&amp;nbsp;&amp;nbsp;Note that these are the same methods used by the&lt;br&gt;
&amp;nbsp;&amp;nbsp;'&amp;nbsp;&amp;nbsp;&amp;nbsp;SF MaintenanceFormToolstrip&lt;br&gt;
&amp;nbsp;&amp;nbsp;Select Case keyData&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Case Keys.Control Or Keys.S&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'-- Clt + S. Use SF StandardForm Save method...saves all configured BOs&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Me.Save()&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Case Keys.Control Or Keys.N&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'-- Clt + N. Use SF STandarForm Add method&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Me.Add()&lt;br&gt;
&amp;nbsp;&amp;nbsp;End Select&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;'-- If key was handled, set message result, if not use base processor&lt;br&gt;
&amp;nbsp;&amp;nbsp;If keyHandled Then&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'-- Trent says this is a good idea...not sure why or what this is, but...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;msg.Result = IntPtr.Zero&lt;br&gt;
&amp;nbsp;&amp;nbsp;Else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;keyHandled = MyBase.ProcessCmdKey(msg, keyData)&lt;br&gt;
&amp;nbsp;&amp;nbsp;End If&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;'-- Return if key was handled&lt;br&gt;
&amp;nbsp;&amp;nbsp;Return keyHandled&lt;br&gt;
End Sub[/codesnippet]&lt;br&gt;
&lt;br&gt;
Hope that helps!</description><pubDate>Thu, 18 Jun 2009 11:27:44 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>