473,287 Members | 1,978 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,287 software developers and data experts.

How to add controls to Controls.Collection?

Hello,

I have an array of controls:
Dim MyControls() As Control
....

How can I add all the controls in MyControls array to a control
collection?

Thanks,
Miguel

Jun 5 '07 #1
1 1082
In VB.NET:

For i As Integer = 0 To MyControls.Length-1
myControlCollection.Add(MyControls(i))
Next

Riki

"shapper" <md*****@gmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
Hello,

I have an array of controls:
Dim MyControls() As Control
...

How can I add all the controls in MyControls array to a control
collection?

Thanks,
Miguel

Jun 5 '07 #2

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

Similar topics

16
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
2
by: Das | last post by:
Hi All, Where does asp.net stores the objects declared in the page. I have a method where I want to loop through all the controls(textbox, HtmlInputText) within the page. I want to in which...
9
by: Merlin | last post by:
Hi, My code below doesn't work does anyone have any pointers? All my controls are programically added. Dim i As Int16 For i = 0 To Me.Controls.Count - 1 If Me.Controls(i).Name <>...
66
by: Cor | last post by:
Hi, I start a new thread about a discussion from yesterday (or for some of us this morning). It was a not so nice discussion about dynamically removing controls from a panel or what ever. It...
6
by: Peter Zolja | last post by:
Hi, I'm building a webcontrol that contains a dynamic list of other controls. My problem is that when I add or remove an item the synchronization between the ViewState and the Controls...
15
by: Arpan | last post by:
Consider the following code which retrieves data from a SQL Server 2005 DB table & displays it in a DataGrid: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)...
0
by: rn5a | last post by:
Suppose I have the following DataGrid: <asp:DataGrid ID="dgUsers" OnUpdateCommand="UpdateDG" runat="server"> <Columns> <TemplateColumn HeaderText="NAME"> <ItemTemplate> <asp:Label...
3
by: Nunzio | last post by:
I am trying to add specific form controls to a VBA collection, so that I can pass the entire collection to another function, and access the individual controls later. I have tried several...
32
by: =?Utf-8?B?U2l2?= | last post by:
I have a form that I programmatically generate some check boxes and labels on. Later on when I want to draw the form with different data I want to clear the previously created items and then put...
9
by: dhtml | last post by:
I have written an article "Unsafe Names for HTML Form Controls". <URL: http://jibbering.com/faq/names/ > I would appreciate any reviews, technical or otherwise. Garrett --...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...

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.