473,378 Members | 1,495 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,378 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 6334
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...
1
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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?

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.