473,699 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1073
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
2577
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 wxGetFreeMemory()". Since wxGetFreeMemory() seemed effectively unused in gtk, I just commented it out in misc_wrap.cpp (didn't want to patch SWIG to regenerate the wrapper code, so hacked the generated cpp source), and replaced...
0
761
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: I've added a few files (images) to an assembly as embedded resources. Within the project folder these files are in a subfolder named "images".
5
1576
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
1089
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 the entire application I want to print the name of all forms to the debug window. TIRislaa
0
1165
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 containing the control, it shows up very briefly (I see a square with the selected color) but then IE crashes, giving me the "send error report to Microsoft" dialog box.
7
9078
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 tried several different approaches for finding the placeholder: This: MyControl = this.FindControl("$form$tabs_repeater$PlaceHolder1"); Produces this error: Object reference not set to an instance of an object.
2
2591
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 .js script files located here THe .js file is marked as embedded resource in VS.
3
2248
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 found. I have used the same namespace for both components.
4
3486
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 experimenting before getting to the actual part. This is what I am trying to do: * Create a tab container dynamically * Create 5 tabs dynamically * Add an update panel to each of the tabs
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8613
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8908
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4374
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.