Link to home
Start Free TrialLog in
Avatar of Ruttensoft
Ruttensoft

asked on

lots of "handles x, y, z...." => Question

Hello

I have lots of buttons, and if I click on one, and I then press a key (1-9), the name of the button should change to the key-value.

I can do it like this:

Private Sub Button14_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Button14.KeyDown, Button15.KeyDown, Button16.KeyDown
        If e.KeyCode > 48 And e.KeyCode < 58 Then
            Button14.Text = e.KeyCode - 48
        End If
    End Sub

But in this example I have 3 buttons "handled", but how can I read in the code which button is "active"?

Thanks!

Sven
ASKER CERTIFIED SOLUTION
Avatar of Manish Chhetia
Manish Chhetia
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial