Ability to setup hotkeys....
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Ability to setup hotkeys....Expand / Collapse
Author
Message
Posted 05/05/2008 8:19:52 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
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?
Post #16129
Posted 05/05/2008 9:45:30 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 9:36:54 PM
Posts: 4,200, Visits: 4,251
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.

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:

Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean
Select Case keyData
    Case Keys.Alt Or Keys.N
 '-- It is always a good idea to supply a result in the message
        msg.Result = IntPtr.Zero
 
 '-- Perform your logic
        ' TODO

 '-- Return out of the method
        Return True

End Select

'-- Perform the default logic here
Return MyBase.ProcessCmdKey(msg, keyData)
End Function

Post #16133
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 12:28am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 9 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.