Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dot net equiv of key code constants?

0 views
Skip to first unread message

mp

unread,
Dec 21, 2009, 8:46:45 PM12/21/09
to
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


Family Tree Mike

unread,
Dec 21, 2009, 10:07:46 PM12/21/09
to

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.

--
Mike

Cor Ligthert[MVP]

unread,
Dec 22, 2009, 3:19:05 AM12/22/09
to
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

"mp" <nos...@Thanks.com> wrote in message
news:#00Dfiqg...@TK2MSFTNGP05.phx.gbl...

Armin Zingler

unread,
Dec 21, 2009, 9:09:59 PM12/21/09
to
mp schrieb:

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.

--
Armin

Herfried K. Wagner [MVP]

unread,
Dec 22, 2009, 2:05:01 PM12/22/09
to
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?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

mp

unread,
Dec 22, 2009, 5:33:31 PM12/22/09
to

"Family Tree Mike" <FamilyT...@ThisOldHouse.com> wrote in message
news:emHEtPrg...@TK2MSFTNGP04.phx.gbl...

thanks for the site!
mark


Cor Ligthert[MVP]

unread,
Dec 23, 2009, 1:46:25 PM12/23/09
to
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

"Herfried K. Wagner [MVP]" <hirf-spa...@gmx.at> wrote in message
news:#mDTqmzg...@TK2MSFTNGP04.phx.gbl...

0 new messages