dot net equiv of key code constants?

  • Thread starter Thread starter mp
  • Start date Start date
M

mp

any clue how to translate this to dotnet, since vbkeycode constants
apparently dont exist there(that i can find)
Public Const VK_SPACEBAR = vbKeySpace
?

as in
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As
Integer
If GetAsyncKeyState(VK_SPACEBAR) Then
...


the closest thing i could find in help was in windows.forms keyeventarg or
such
couldn't figure out how to use that plus the project wasn't using winforms
for anything else

thanks
mark
 
mp said:
any clue how to translate this to dotnet, since vbkeycode constants
apparently dont exist there(that i can find)
Public Const VK_SPACEBAR = vbKeySpace
?

as in
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As
Integer
If GetAsyncKeyState(VK_SPACEBAR) Then
...


the closest thing i could find in help was in windows.forms keyeventarg or
such
couldn't figure out how to use that plus the project wasn't using winforms
for anything else

It's not mentioned here

http://msdn.microsoft.com/en-us/library/aa302340.aspx#win32map_keyboardinputfunctions

and I didn't find it in the Framework, so I guess you have to use the API function.
Don't forget to change Long to Integer and Integer to Short.
 
any clue how to translate this to dotnet, since vbkeycode constants
apparently dont exist there(that i can find)
Public Const VK_SPACEBAR = vbKeySpace
?

as in
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As
Integer
If GetAsyncKeyState(VK_SPACEBAR) Then
...


the closest thing i could find in help was in windows.forms keyeventarg or
such
couldn't figure out how to use that plus the project wasn't using winforms
for anything else

thanks
mark

Sorry if this is not what you were asking for, as I have had a long
day... The Virtual Key definitions can be copied from
http://www.pinvoke.net/default.aspx/Enums/VirtualKeys.html, for use in a
VB.Net application.

That site is a good one to keep in your favorites.
 
I never use these so called constants, does remember me to much of the bad
old days.

I simply use the value what they represent.

Success

Cor
 
Am 22.12.2009 09:19, schrieb Cor Ligthert[MVP]:
I never use these so called constants, does remember me to much of the
bad old days.

I simply use the value what they represent.

How to transfer 'GetAsyncKeyState' to the .NET world then?
 
Herfried,

To be honest, I use them seldom, I never was a real VB6 developer you know.

The only way I know sometimes use them in Net is with that removing of the
minimize box you once showed.

(Probably some more, but I forget them forever)

Cor
 
Back
Top