473,320 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Finding embedded controls?

Hello,
I am trying to write code to clear all the textboxes on a VB.NET
windows form using:

Dim ctrl As Control
For Each ctrl In Me.Controls
'Add your code here
If TypeOf ctrl Is TextBox Then
ctr.text = ""
End If
Next

When I debug, I realized that none of the text boxes are being
recognized as they are present within tabcontrol and embedded within a
frame.

So how exactly do we find out all the controls that are present on a
tabpage and are embedded within a frame?

Any Help is appreciated.

Sep 26 '06 #1
2 1055
I found out the solution...
Dim ctrl, ctrl2 As Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is Panel Then
For Each ctrl2 In ctrl.Controls
If ctrl2.Text = "Go" Then
' Do Something
End If
Next
End If

Sep 26 '06 #2
That works if you are only looking for the panel's child controls. What if
you have a panel within a panel that contains textboxes? Try recursion.
--
Dennis in Houston
"IdleBrain" wrote:
I found out the solution...
Dim ctrl, ctrl2 As Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is Panel Then
For Each ctrl2 In ctrl.Controls
If ctrl2.Text = "Go" Then
' Do Something
End If
Next
End If

Sep 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Vio | last post by:
Hi, I've been trying to embed (statically) wxPy alongside an embedded py interpreter on a linux/gtk box. At one point, for some reason misc.o linking reported "multiple definitions of...
0
by: Philipp Seidel | last post by:
Hi there! I did not know, where this topic fits in, so I put it here. I have a minor problem with embedded resources, which puzzles me quite a lot. I'd be glad if anyone can help me on this: ...
5
by: A Lonely Programmer | last post by:
Hi group, Consider the following code: Dim dirinfo As New DirectoryInfo("c:\test") Dim fileinfo() As FileInfo = dirinfo.GetFiles Dim fi As FileInfo
3
by: Tor Inge Rislaa | last post by:
Finding name and type In the activate procedure of a form I want to write to the debug window, name and type of all controls at that actual form. Is there a smart way to do that? Allso for...
0
by: Steven Spits | last post by:
Hi, I'm creating an embedded control for IE in VS 2005. For testing purpose, I have left the user control completely blank and only changed the background color. When navigating to the page...
7
by: Brad Baker | last post by:
I am trying to programmatically set a placeholder control in csharp which is nested inside a repeater control between <ItemTemplateand </ItemTemplate> tags, however I am running into problems. I've...
2
by: zb | last post by:
I have my code directory structured this way App App\Pages <- contains ASPX files App\Pages\Common App\Pages\Common\Controls <- has user controls App\Pages\Common\Controls\SupportingJS <- has...
3
by: Dave Kelly | last post by:
c#, .Net 2.0, VS2008 I have a user control, and wish to embed other custom/user controls within this control. I am getting problems in compilation though, that the type or namespace cannot be...
4
by: karthik25 | last post by:
Hi All, I have a problem in finding control in a dynamically created updated panel. I have given the code below. Following is just a starting effort in a completely dynamic user control. I am...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.