473,503 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

create control array in vb.net

Tom
Dear All :

How to create control array class in vb.net
and how to use loop method so that add all button of cuurent form into
collection class

Thanks
Nov 21 '05 #1
2 3913
"Tom" <pc***@tomgroup.com> schrieb:
How to create control array class in vb.net


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/>
Nov 21 '05 #2
Tom,

All child controls are in the collection from its parent. Therefore often
there is no need to create that array.

When you want by instance all buttons that are directly on your form than
you can do

\\\\
for each ctr as control in me.controls
if Typeof ctr Is Button then
'do something
end it
Next
///

I hope this helps,

Cor
Nov 21 '05 #3

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

Similar topics

4
22135
by: Tom Rathbun | last post by:
This is probably simple but it has stumped me. I want to create objects at runtime for example: A program that would allow you to draw lines on a form. For each new line I would like to create a...
1
1626
by: SAN CAZIANO | last post by:
is there a function that get the name of the first input field of the current form ? in my example below I want create an array of form field name and in the onsubmit assign all element's name to...
3
32475
by: jhs | last post by:
Hello, I developping a .NET windows form application an need some help to create an array of System.Windows.Forms.Label in order to be able to manage all of them using index. I'm trying to do...
1
1126
by: michele | last post by:
Hi, i'm trying to create some htmlinputfile controls at runtime in my page, based on a integer variable (for example 5) This is simple for the html code, but i don't know how to manage them in the...
8
2225
by: ASP Yaboh | last post by:
I have an ArrayList of data gathered from a database. I want to create a web page from this data by creating a <table>, each cell in each row displays the appropriate data. One of those cells in...
4
1676
by: Rich | last post by:
Hello, I have 3 textboxes and 1 combobox on a form. On entering the control I want to select all the text. I can make an array of textboxes like this: Dim arrTxt As TextBox() = {txt1, txt2,...
3
19254
by: Richard Hollenbeck | last post by:
Hello, In regular VB, I remember I could create a generic label (call it something like lblFieldNames) and copy it and paste it. VB would say that I already have an object by that name then ask...
4
5642
by: | last post by:
Hi all, I want to create a method that does the following: 1) Programmatically instantiate a new XmlDataSource control 2) For each file in a named directory, make a "FileSystemItem" element 3)...
2
2807
by: Boki | last post by:
Hi All, I remember in VB6, we can create any component array just by copy and paste, and the IDE will ask us to use a component array or not. I did the same thing on C#, it will auto create the...
3
4460
by: 100grand | last post by:
Modify the Inventory Program to use a GUI. The GUI should display the information one product at a time, including the item number, the name of the product, the number of units in stock, the price...
0
7194
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,...
0
7070
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...
0
7267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3160
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...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
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 ...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
372
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...

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.