I'm trying to create my own form control.
Went through all the File->New->Project, selected Windows Control Library.
I want to capture if a function key is depressed and I tried both the KeyDown event and the Key Press event.
However when run the control in a form, neither event is being captured.
What am I doing wrong?
I've tried putting break points at the top of the two delegates above, but the code never enters and runs.
Help!
Went through all the File->New->Project, selected Windows Control Library.
I want to capture if a function key is depressed and I tried both the KeyDown event and the Key Press event.
Code:
Private Sub UserControl1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
'My Code here
End Sub
Private Sub UserControl1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
'My Code here
End Sub
However when run the control in a form, neither event is being captured.
What am I doing wrong?
I've tried putting break points at the top of the two delegates above, but the code never enters and runs.
Help!