Click to See Complete Forum and Search --> : KeyPressEventArgs Event


Titi
April 9th, 2003, 05:36 AM
Hi,

This my ASPX page (a part) :


Imports System.Data
Imports System.Data.SqlClient

Public Class Connexion
Inherits System.Web.UI.Page
Protected WithEvents TextBoxMDP As System.Web.UI.WebControls.TextBox
Protected WithEvents ImageButtonValider As System.Web.UI.WebControls.ImageButton


I would like if an user press the 'Enter' key into my TextBox
then the ImageButtonValider_Click would be launch

This function does'nt work :

Private Sub TextBoxMDP_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs ) Handles TextBoxMDP.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then
e.Handled = True
End If
End Sub

If you can help me
:confused:
Thanx a lot

Titi