mcerk Posted December 9, 2004 Posted December 9, 2004 Hi. I want to catch if delete key was pressed in listbox control. Private Sub ListBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ListBox1.KeyPress Me.Text = e.KeyChar Select Case e.KeyChar End Select in this code just characters are recognised. If I press 'Del' nothing happens. any help. tx matej Quote
*Experts* DiverDan Posted December 9, 2004 *Experts* Posted December 9, 2004 Give this a try. Private Sub ListBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ListBox1.KeyDown If e.KeyCode = Keys.Delete Then MessageBox.Show("delete") End If End Sub Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.