Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fastest way to scan for textbox controls
Message
From
10/12/2012 15:42:03
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Fastest way to scan for textbox controls
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01559234
Message ID:
01559234
Views:
82
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
Next
Reply
Map
View

Click here to load this message in the networking platform