Try this:
Code:Label1.Text = e.KeyChar.ToString
How do i get the pressed key?
I did this:
But i want to get F5 and that keys..Code:Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Form1.KeyPress Dim PressedKey As String = Asc(e.KeyChar) Label1.Text = PressedKey End Sub
Last edited by Lyoto Machida; 02-06-2011 at 02:57 PM.
Try this:
Code:Label1.Text = e.KeyChar.ToString
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
Handle the keydown then:
Code:Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown Label1.Text = CType(e.KeyCode, Keys).ToString End Sub
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
"Keys" is an enum. So basically what I did was convert the integer represented in "e.KeyCode" to it's counterpart in the enum (the one with the same value as the integer) then called ".ToString" to convert this into a string. For example, say I have an enum like this:
Code:Enum Test Test1 = 1 Test2 = 2 Test3 = 69 End Enum
And I have the integer 69, so I want to get the string "Test3" from the enum.
Code:CType(69, Test).ToString
I convert 69 to it's counterpart in the Enum (i.e the Test3 block) then call ".ToString" to get the name of the block ("Test3")
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
Plus, DirectCast has been obsolete for awhile, it's only a matter of time before it is completely removed form the framework, meaning somewhere download the line, apps using directcast will fail.
Stick to ctype.
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
I do hate the fact that it is obsolete, so much of my past applications use direccast over Ctype, so eventually there may be a lot of failing apps.
But, Still sharing the truth, it is Obsolete