Intercepter l'appui de la touche Tabulation

X

xlaxague

Bonjour,

Dans une winform, je cherche à intercepter l'évènement généré par
l'appui de la touche tabulation.

J'ai essayé d'intercepter les évènements KeyPress, KeyDown et KeyUp.
Par exemple :

Private Sub frmProposition_KeyDown(ByVal sender As Object, ByVal e
As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyData = Keys.Tab Then
_messageOK = False
End If
End Sub

J'ai également essayé de procéder de cette manière :

Protected Overrides Sub OnKeyDown(ByVal e As
System.Windows.Forms.KeyEventArgs)
If e.KeyCode = Keys.Tab Then
MessageBox.Show("OK")
End If
End Sub

Toutes ces méthodes interceptent l'appui d'une touche mais pas l'appui
de la touche tabulation.
Savez-vous comment procéder ?

Merci d'avance.
 
C

Cor Ligthert[MVP]

Hi,

If you use the key-up you will see in the information from the e (event)
much more information than when it was pressed.

Will you be so kind to use next time in English. This is not an English
newsgroup (there is no UK or US at the end), however many users are from
English speaking countries, using an English version of Visual Studio or
just like to communicate here because beside that the community members in
this group are very international.

Therefore we use English as our communication language.

Thanks in advance,

Cor

<[email protected]> schreef in bericht
Bonjour,

Dans une winform, je cherche à intercepter l'évènement généré par
l'appui de la touche tabulation.

J'ai essayé d'intercepter les évènements KeyPress, KeyDown et KeyUp.
Par exemple :

Private Sub frmProposition_KeyDown(ByVal sender As Object, ByVal e
As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyData = Keys.Tab Then
_messageOK = False
End If
End Sub

J'ai également essayé de procéder de cette manière :

Protected Overrides Sub OnKeyDown(ByVal e As
System.Windows.Forms.KeyEventArgs)
If e.KeyCode = Keys.Tab Then
MessageBox.Show("OK")
End If
End Sub

Toutes ces méthodes interceptent l'appui d'une touche mais pas l'appui
de la touche tabulation.
Savez-vous comment procéder ?

Merci d'avance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top