473,394 Members | 1,766 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.

How do you create an object array in VB.NET? It was bloody easy in VB5/6

Hi Gang,
I can't seem to figure out how to create an object array in VB.NET 2003. In
VB6 you would just select an object copy and paste it and that was that. I
don't know why in the heck they decided to change that. I thought it was
great. I assume a 2002 answer would work in 2003 as well. Can somebody
tell me how to create an object array or point me to an MSDN article
regarding it?
Thanks,
Christian Blackburn
Nov 19 '05 #1
6 24570
Hello,

"Christian Blackburn" <Christian@Damn@Sp**@Hotmail.com> schrieb:
I can't seem to figure out how to create an object array in VB.NET
2003. In VB6 you would just select an object copy and paste
it and that was that.


Creating Control Arrays in Visual Basic .NET and Visual C# .NET
http://msdn.microsoft.com/library/?u...VisualCNET.asp

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 19 '05 #2
Hi Herfried,
Thank you very much for the help. I personally find this astounding that
Visual Basic 2003 does not native support for object arrays something I'm
pretty sure VB 1.0 for dos did! I don't know what's worse that VB 2002
didn't have object arrays or that 2003 didn't fix it :). All the same I
really appreciate your help and I'll go through their work around.
Cheers,
Christian

"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:Ot**************@TK2MSFTNGP12.phx.gbl...
Hello,

"Christian Blackburn" <Christian@Damn@Sp**@Hotmail.com> schrieb:
I can't seem to figure out how to create an object array in VB.NET
2003. In VB6 you would just select an object copy and paste
it and that was that.
Creating Control Arrays in Visual Basic .NET and Visual C# .NET

http://msdn.microsoft.com/library/?u...VisualCNET.asp
HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet

Nov 19 '05 #3
Hello,

"Christian Blackburn" <Christian@Damn@Sp**@Hotmail.com> schrieb:
Visual Basic 2003 does not native support for object arrays
something I'm pretty sure VB 1.0 for dos did! I don't know
what's worse that VB 2002 didn't have object arrays or that
2003 didn't fix it :).


I am pretty sure (hoping) they will add control arrays in a future
release.

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 19 '05 #4
Hi Christian, Herfried,

There's a help topic: Control Array Changes in Visual Basic .NET

ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vbconcontrolarraychangesinvisualbasic
net.htm

which says:

In Visual Basic .NET, control arrays are no longer supported. Changes to
the event model make control arrays unnecessary. Just as control arrays in
Visual Basic 6.0 could share events, the event model in Visual Basic .NET
allows any event handler to handle events from multiple controls. In effect,
this allows you to create groups of controls of disparate types that share
the same events.

I think they missed the point a bit.

Regards,
Fergus
Nov 19 '05 #5
Hi Fergus,
Thank you very much for the link. It didn't work in VB 2003.NET Trial even
though that does come with MSDN. However this worked great:
http://msdn.microsoft.com/library/de...albasicnet.asp

and is of course the same URL more or less :).

I will also be reading the articles below, but what you sent me is a major
start towards reducing the bloat of my code so I already implemented what
you sent me and I'll read that big VB 2003 article in the morning (see
below). You see I have a board type game and currently it's 5x5 squares
(remember I'm talking functional squares that store pieces, not pixels
here), but I want it to be configurable for almost any WxH (width by height)
in squares.

VB Any and C#:
http://msdn.microsoft.com/library/de...visualcnet.asp

VB 2003 Only:
http://msdn.microsoft.com/library/de...trolarrays.asp

Cheers,
Christian
"Fergus Cooney" <wo****@tesco.net> wrote in message
news:OD**************@TK2MSFTNGP10.phx.gbl...
Hi Christian, Herfried,

There's a help topic: Control Array Changes in Visual Basic .NET

ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vbconcontrolarraychangesinvisualbasic net.htm

which says:

In Visual Basic .NET, control arrays are no longer supported. Changes to the event model make control arrays unnecessary. Just as control arrays in
Visual Basic 6.0 could share events, the event model in Visual Basic .NET
allows any event handler to handle events from multiple controls. In effect, this allows you to create groups of controls of disparate types that share
the same events.

I think they missed the point a bit.

Regards,
Fergus

Nov 20 '05 #6
Hi Fergus,

"Fergus Cooney" <wo****@tesco.net> wrote in message
news:OD**************@TK2MSFTNGP10.phx.gbl...
In Visual Basic .NET, control arrays are no longer supported. Changes to the event model make control arrays unnecessary. Just as control arrays in
Visual Basic 6.0 could share events, the event model in Visual Basic .NET
allows any event handler to handle events from multiple controls. In effect, this allows you to create groups of controls of disparate types that share
the same events.

I think they missed the point a bit.
I couldn't agree more. There just isn't an easier way to make and work with
multiple objects of the same type. I'm sure I'm not the only board game
author out there that misses object arrays. The thing about their new event
model is that in VB6 if you created a procedure each event from every object
type can call the procedure so that sort of global event handling was
already possible :).
Cheers,
Christian Blackburn

Nov 20 '05 #7

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

Similar topics

2
by: Rudi | last post by:
Is there anyone who can point me to a good tutorial on how to create a multithreaded class library? Class A is a controller that starts up a number of threads of code in Class B. Class B raises...
2
by: Mriganka | last post by:
I want to create a hierarchical tree from the array of strings obtained by extracting a jar file.I want to do this using Javascript. For ex, I am having the entries in the array as...
16
by: sneill | last post by:
How is it possible to take the value of a variable (in this case, MODE_CREATE, MODE_UPDATE, etc) and use that as an object property name? In the following example I want 'oIcon' object to have...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
1
geo039
by: geo039 | last post by:
Okay I have an application, which is to demonstrate the use of a created class. I have a previous and next button which cycles through the array. However I need the user to be able to create a new...
10
by: SM | last post by:
Hello I'm trying to create a multi dimensional array in JavaScript, but after some reading i still can't figure out how to apply it to my model. Here it is: I have a list A and for each item...
6
by: The Natural Philosopher | last post by:
I am trying to create what amounts to an array of 'structures'. I.e. I want to dynamically add to and access an object as myobject.anothernumber // actually represents a nesting level. and ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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.