PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
dynamically Refernce control
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
dynamically Refernce control
![]() |
dynamically Refernce control |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I want to build a reference to a WinForms control but I can't seem to do it...
I want to do something like (I know this is wrong): me.Controls("Textbox" & i).Text = "Hello World!" But I can't seem to figure it out. Please help. Kent. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
in c#, you can change this to:
((TextBox)this.Controls("Textbox" & i)).Text = "Hello World!" i think vb.net will be alike. "KentG" <KentG@discussions.microsoft.com> дÈëÓʼþ news:04620064-56E0-4CF0-A88F-57861BDAA897@microsoft.com... > I want to build a reference to a WinForms control but I can't seem to do it... > > I want to do something like (I know this is wrong): > > me.Controls("Textbox" & i).Text = "Hello World!" > > But I can't seem to figure it out. Please help. > > Kent. |
|
|
|
#3 |
|
Guest
Posts: n/a
|
"KentG" <KentG@discussions.microsoft.com> schrieb:
>I want to build a reference to a WinForms control but I can't seem to do >it... > > I want to do something like (I know this is wrong): > > me.Controls("Textbox" & i).Text = "Hello World!" Accessing controls by their names or indices <URL:http://dotnet.mvps.org/dotnet/faqs/?id=controlbynameindex&lang=en> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

