Parth48
asked on
how can i search textbox control on the current form in C#.net windows application ??
i want to know that how can i search textbox control on the current form in C#.net windows application ??
without linq how can i do it ??
without linq how can i do it ??
Why wouldn't you use LINQ ? If you really not want to do that, you'll need to implement a loop over all your controls
Example without linq
foreach (Control con in mainForm.Controls)
{
if ( control is Textbox && control.Name = ""YourTextBox")
// now you have your textbox
}
See also: http://www.dotnetperls.com/query-windows-forms
Example without linq
foreach (Control con in mainForm.Controls)
{
if ( control is Textbox && control.Name = ""YourTextBox")
// now you have your textbox
}
See also: http://www.dotnetperls.com/query-windows-forms
You can also use the Old Way ;-)
TextBox MyTextBox = control.FindControl("YourT extBox") as TextBox;
TextBox MyTextBox = control.FindControl("YourT
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Open in new window
now how can i find above textbox(txtPasskey) without linq ??