Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fastest way to scan for textbox controls
Message
De
10/12/2012 15:42:03
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Fastest way to scan for textbox controls
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01559234
Message ID:
01559234
Vues:
80
I would like to verify if this approach is the fastest way to scan for textbox controls in a form:
                ' For each control in this form
                For Each loControl In loHtmlForm.Controls

                    ' If this is a textbox
                    If loControl.GetType().ToString = "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
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform