Click here to Skip to main content
15,891,846 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Sir,
i just want to know how to identify the objects that are present in the screen of an application.
These may include a text box,button and so on.
Please tell the algorithm for it.
Regards
Posted

1 solution

VB
For Each oControl As Control In Me.Controls
    If TypeOf oControl Is TextBox Then
        ' Do Something
    End If
Next


C#
foreach (Control oControl in this.Controls) {
	if (oControl is TextBox) {
		// Do Something
	}
}
 
Share this answer
 
v2
Comments
Kim Togo 14-Aug-14 9:27am    
Right on! :-)
Ashi0891 14-Aug-14 10:00am    
Well done.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900