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

Creating control arrays at design time.

In VB6 (using visual studio) it was possible to create a control array at
design time by simply adding the control (e.g. textbox) and renaming it to
what would become the first element
e.g.

Name => MyTextbox
to
Name => MyTextbox(1)

you could then copy this control array element and paste back onto form to
add a new element to the control array.
Is this possible using Visual Studio 2003? I've seen the following
http://msdn.microsoft.com/library/de...visualcnet.asp
but cannot find anything about doing this at design time (it was sooooo easy
before!)

Any ideas/ thoughts anyone?

Cheers.

--

Br,
Mark Broadbent
mcdba , mcse+i
=============
Nov 16 '05 #1
3 6342
look at the direction of System.WIndows.Forms.Design namespace

"Mark Broadbent" <no************@no-spam-please.com> wrote in message
news:O#**************@TK2MSFTNGP11.phx.gbl...
In VB6 (using visual studio) it was possible to create a control array at
design time by simply adding the control (e.g. textbox) and renaming it to
what would become the first element
e.g.

Name => MyTextbox
to
Name => MyTextbox(1)

you could then copy this control array element and paste back onto form to
add a new element to the control array.
Is this possible using Visual Studio 2003? I've seen the following
http://msdn.microsoft.com/library/de...us/dv_vstechar
t/html/vbtchcreatingcontrolarraysinvisualbasicnetvisualcn et.asp but cannot find anything about doing this at design time (it was sooooo easy before!)

Any ideas/ thoughts anyone?

Cheers.

--

Br,
Mark Broadbent
mcdba , mcse+i
=============

Nov 16 '05 #2
It is still easy depending on what you want to do. While VB had it to
help users create "dynamic" controls which was otherwise not possible
without control arrays, in C# you can create any number of controls and
add it to an array list and achieve the same thing.

Mark Broadbent wrote:
In VB6 (using visual studio) it was possible to create a control array at
design time by simply adding the control (e.g. textbox) and renaming it to
what would become the first element
e.g.

Name => MyTextbox
to
Name => MyTextbox(1)

you could then copy this control array element and paste back onto form to
add a new element to the control array.
Is this possible using Visual Studio 2003? I've seen the following
http://msdn.microsoft.com/library/de...visualcnet.asp
but cannot find anything about doing this at design time (it was sooooo easy
before!)

Any ideas/ thoughts anyone?

Cheers.


--
Regards,
Dilip Krishnan
MCAD, MCSD.net
dilipdotnet at apdiya dot com
Nov 16 '05 #3
Hi Dilip, yeah had a play with the ArrayList with regards to this. You are
right it is relatively easy and gives me the functionality I had. Just a
couple of points on this though.
Firstly to access the textbox's as such I need to cast them to a TextBox
type (since they are added to the collection as Object), the control array
in VB6 was of the type of the first control (not object).
Secondly I am having to code functionality that the designer (in VS6)
previously did effortlessly by just naming a control using an index .

-I just hoped that the designer retained this functionality -regardless of
the code that is eventually generated.

--

Br,
Mark Broadbent
mcdba , mcse+i
=============
"Dilip Krishnan" <dilipdotnet..NOSPAM..@apdiya.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
It is still easy depending on what you want to do. While VB had it to
help users create "dynamic" controls which was otherwise not possible
without control arrays, in C# you can create any number of controls and
add it to an array list and achieve the same thing.

Mark Broadbent wrote:
In VB6 (using visual studio) it was possible to create a control array at design time by simply adding the control (e.g. textbox) and renaming it to what would become the first element
e.g.

Name => MyTextbox
to
Name => MyTextbox(1)

you could then copy this control array element and paste back onto form to add a new element to the control array.
Is this possible using Visual Studio 2003? I've seen the following
http://msdn.microsoft.com/library/de...visualcnet.asp but cannot find anything about doing this at design time (it was sooooo easy before!)

Any ideas/ thoughts anyone?

Cheers.


--
Regards,
Dilip Krishnan
MCAD, MCSD.net
dilipdotnet at apdiya dot com

Nov 16 '05 #4

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

Similar topics

3
by: Mark Broadbent | last post by:
In VB6 (using visual studio) it was possible to create a control array at design time by simply adding the control (e.g. textbox) and renaming it to what would become the first element e.g. ...
0
by: Andrew Baker | last post by:
I have a progress bar which is nested control and I want to persist the design time properties of this nested control. I thought all I needed to do was mark it with the...
0
by: Dirk | last post by:
Hello, What is the the best approach to have design time support for a custom control derived from one of the standard controls in the toolbox. Let's say I derive from listview and I don't want...
0
by: Nikhil Patel | last post by:
Hi all. I have written a custom DataGrid control which inherits from ASP.Net DataGrid control. When I drop this control on an ASP.Net form, it does not display the grid properly. It says error...
0
by: pedrobernabeu | last post by:
I have a custom control with a ListItemCollection. If I add items by hand in the aspx and switch to design time view, everything works fine. However if I add items through the Collection Editor,...
0
by: Zorpiedoman | last post by:
Get your expert hat on.... I've created a UserControl which inherits ContainerControl. When I drop another control onto this control in design time view, I want to rename the new control and...
3
by: mpg | last post by:
using vb express 2005 trying to insert a spreadsheet control onto a form. i have added the reference for excel object 11.0 i cant figure out where to FIND the object to paste the control on my...
1
by: --== Alain ==-- | last post by:
Hi, I still have problem updating my custom control at design time. When i change a property of my custom control in the property window, i would like to see this change immediately on my custom...
1
by: =?Utf-8?B?QnJldHQ=?= | last post by:
I have a basic user control that I want to localize. I created a global resource and connected up the properties I want to localize using an explicit localization expression. Everything works...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.