Substituting Ctrl for Alt keys

G

Guest

We upgraded a vb project to vb.net and added many enhancements. The old
project was not an MDI and used buttons for functions like adding a record
(Alt A), deleteing a record etc. This is a data entry app so user speed is
of utmost importance. Now we have an MDI interface, but the users would like
to keep their Alt keystrokes because of speed/retraining issues. We also
would like to introduce Ctrl keystrokes with the hopes of phasing out the
Alt. We'd like a solution that doesn't replicate code. Is there a way to
capture the Alt-A in a form and change it to a Ctrl-A that the MDI parent
would then pick up? For other reasons, we do have KeyPreview turned on in
the child forms. Any thoughts? Thanks.
 
D

David Lloyd

Lisa:

If you have not looked at overriding the ProcessCmdKey method, this may be
one alternative to capturing the key strokes on your form. The following KB
article gives more information about capturing key strokes in VB.NET. I
don't know if this will meet your requirements, however, I thought I would
pass it along.

http://support.microsoft.com/default.aspx?scid=kb;en-us;320583

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


We upgraded a vb project to vb.net and added many enhancements. The old
project was not an MDI and used buttons for functions like adding a record
(Alt A), deleteing a record etc. This is a data entry app so user speed is
of utmost importance. Now we have an MDI interface, but the users would
like
to keep their Alt keystrokes because of speed/retraining issues. We also
would like to introduce Ctrl keystrokes with the hopes of phasing out the
Alt. We'd like a solution that doesn't replicate code. Is there a way to
capture the Alt-A in a form and change it to a Ctrl-A that the MDI parent
would then pick up? For other reasons, we do have KeyPreview turned on in
the child forms. Any thoughts? Thanks.
 
G

Guest

Thank you for your reference; however, if I implement this solution, does
that mean that I would need to create a Control class for every type of
control on my form so that Alt A could be captured from anywhere on the form?
I have comboboxes, text boxes, list boxes, etc on my form. No matter where
the user is located, I would like Alt A to behave as Ctrl A does. Thanks
 
P

Peter Huang [MSFT]

Hi

Have you tried the KeyPreview which will help you capture the key messages
in the function?
Did that works for you?
If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Thanks for your message. We have tried implementing the Alt using
KeyPreview. We can do it successfully, however we have the problem with the
"beep" (which seems to be widely known) after the use of the Alt key. Plus
we actually have 2 MDI child forms, they can press ALT A in either and it
should perform an Add in the one form. This results in duplicate code, not
to mention "sloppy code". Any thoughts?
 
P

Peter Huang [MSFT]

Hi

Do you mean when you click the Alt there is a Beep occur,based on my test,
it seems there is no such sound.
If I have any misunderstanding, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top