Code in vb.net in key down event works in Windows XP but not in Win7 ?

I have written code in vb.net where i assign character to Control+D and Alt+D.
Both these work fine in Win XP
but in Win7 only Control+D works but Alt+D does not work.
This was observed on a 64 bit machine.
gawacha1Asked:
Who is Participating?
 
btanExec ConsultantCommented:
Will you want to try the registrykey apiece for alt d in the link

http://stackoverflow.com/questions/5619481/what-keys-are-represented-by-the-h-hex-codes
0
 
btanExec ConsultantCommented:
Saw a sample for all .NET framework but they did not listed XP though
http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx

and even platform support for .net
http://msdn.microsoft.com/en-us/library/8z6watww.aspx

Wondering if you using the similar codes
0
 
gawacha1Author Commented:
Dear breadtan
my problem is that that same code for 'Alt D' key-replacement works in WinXP but not in Win7
Regards
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
btanExec ConsultantCommented:
Are you using either of the below to detect Alt key and is working (not to say even Alt+D)?

\\\-----------------
If (Windows.Forms.Control.ModifierKeys And Keys.Control) <> 0 Then
Debug.WriteLine("Ctrl is pressed")
End If
If (Windows.Forms.Control.ModifierKeys And Keys.Shift) <> 0 Then
Debug.WriteLine("Shift is pressed")
End If
If (Windows.Forms.Control.ModifierKeys And Keys.Alt) <> 0 Then
Debug.WriteLine("Alt is pressed")
End If
///-----------------

\\\-----------------
If (My.Computer.Keyboard.AltKeyDown) Then
or
If (My.Computer.Keyboard.CtrlKeyDown) Then
or
If (My.Computer.Keyboard.ShiftKeyDown) Then
///-----------------
0
 
btanExec ConsultantCommented:
Also on the "Form.KeyPreview" Property, when it is set to true, the form will receive all KeyPress, KeyDown, and KeyUp events. This is applicable for the first example code in my earlier feedback above

http://msdn.microsoft.com/en-us/library/system.windows.forms.form.keypreview(v=vs.71).aspx
0
 
gawacha1Author Commented:
I have done keypreview true. i have done e.handled=true.
If e.Alt And e.keycode=keys.D Then

e.handled=true
Textbox1.selectedText="a"

End If
This works fine in WinXP but not in Win7 / 64bit
0
 
btanExec ConsultantCommented:
Wouldnt know why but seems like the requirement did not explicity state whether 32 or 64 bits. thinking whether even e.Alt alone can be detected ? trying to isolate which is the culprit key and I suspect Alt...

also if we will to run the appl in XP mode ... wonder if that can help
http://windows.microsoft.com/is-IS/windows7/install-and-use-windows-xp-mode-in-windows-7
0
 
gawacha1Author Commented:
Dear Breadtan
I m myself not clear on this
will revert
Regards
0
 
gawacha1Author Commented:
Dear Breadtan

Alt D code is not working in 64bit Windows7.

Kindly suggest solution

Regards
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.