If TypeOf loControl Is System.Web.UI.WebControls.TextBox Then>This is the updated code:
> ' For each control in this form > For Each loControl In loHtmlForm.Controls > > ' If this is a textbox > If loControl Is System.Web.UI.WebControls.TextBox Then > > ' Assign this control to a textbox variable > loTextbox = loControl > > ' Add the onkeypress to the textbox > loTextbox.Attributes.Add("onkeypress", "FormKeyPress(event)") > > End If > > Next >>