acces a control by its name
acces a control by its name
acces a control by its name
acces a control by its name
acces a control by its name
acces a control by its name acces a control by its name acces a control by its name acces a control by its name acces a control by its name acces a control by its name acces a control by its name acces a control by its name
acces a control by its name acces a control by its name
acces a control by its name
Go Back  Xtreme Visual Basic Talk > > > acces a control by its name


Reply
 
Thread Tools Display Modes
  #1  
Old 12-18-2003, 07:31 AM
paulpiscoi paulpiscoi is offline
Newcomer
 
Join Date: Nov 2003
Posts: 11
Question acces a control by its name


Hello

how can I acces a control using a string representing the name of that control?

In vb 6 it was Controls("TextBox1").text="blablabl" but it seems do be different in .NET.

Thank you,

Paul.
Reply With Quote
  #2  
Old 12-18-2003, 07:49 AM
Csharp's Avatar
Csharpacces a control by its name Csharp is offline
Senior Contributor

* Expert *
 
Join Date: Jul 2003
Location: Ashby, Leicestershire.
Posts: 967
Default

like this ...
Code:
Dim ctl As Control For Each ctl In Controls If ctl.GetType Is GetType(TextBox) Then If ctl.Name = "TextBox1" Then ctl.Text = "some text" End If End If Next
__________________
~~ please don't PM me regarding code, I only reply to personnal messages ~~
Reply With Quote
  #3  
Old 12-18-2003, 08:04 AM
paulpiscoi paulpiscoi is offline
Newcomer
 
Join Date: Nov 2003
Posts: 11
Default

Thanks
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MsFlexGrid & VBA msl Word, PowerPoint, Outlook, and Other Office Products 2 09-17-2006 03:21 PM
multi connections, one port? burningodzilla Communications 5 08-02-2005 05:04 PM
Output to a file dejota6 General 7 07-15-2003 01:09 AM
WinSock vbsupernewbie Communications 1 09-12-2001 10:20 PM
Control Arrays: What, Why and How BillSoo Tutors' Corner 0 07-13-2001 12:46 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
acces a control by its name
acces a control by its name
acces a control by its name acces a control by its name
acces a control by its name
acces a control by its name
acces a control by its name acces a control by its name acces a control by its name acces a control by its name acces a control by its name acces a control by its name acces a control by its name
acces a control by its name
acces a control by its name
 
acces a control by its name
acces a control by its name
 
-->