PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
Finding a Control in a Form at run time
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
Finding a Control in a Form at run time
![]() |
Finding a Control in a Form at run time |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Greetings,
I have a form with many controls on it. At run time I like to be able to get the control from the form using its name. For example GetControl(SomeControlName) as control is there a way to do this without going trough all the controls and checking their name one by one. Shahin |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Maybe add a Public property to the form that references the control itself.
Then from any form that has a reference to the form, you can get that control by name via the public property. -- William Stacey "Shahin Kohan" <shahin@valleris.com> wrote in message news:%23p%23yhh2ODHA.2228@tk2msftngp13.phx.gbl... > Greetings, > > I have a form with many controls on it. At run time I like to be able to get > the control from the form using its name. For example > > GetControl(SomeControlName) as control > > is there a way to do this without going trough all the controls and checking > their name one by one. > > Shahin > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

