hello mr das,
actually what exactly i want is, when i click L on my keyboard then all the code written in label1_click even is executed.....i have tried using what you have posted ba its not working....
I did exactly what debasisdas posted and it does exactly what you want.
You do need to set your form's KeyPreview property to true. On the designer click on your form and in the properties window find KeyPreview and set it to true. Or in the load event you could add Me.KeyPreview = True .
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.KeyPreview = True
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If e.KeyChar = "l" Then
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
cant we use a keydown event?
earlier in my project i have used keydown event to be invoked on the button shortcuts.
Private Sub Form3_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.l Then
Me.KeyPreview = False
i jst changed the handles me.keypress to handles mybase.keypress
and now its working......
thanx every1 for your help.
IT WAS GIVING ERROR on 'me' as "keyword is not a valid identifier".
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...