PC Review


Reply
Thread Tools Rate Thread

Declaring a collection as a particular type of object or a particular class

 
 
Ronald Dodge
Guest
Posts: n/a
 
      15th Nov 2007
Is there a way to declare a collection object as a collection of a
particular type of object or as a collection of a particular class? Would
like this for intellisense purposes.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000


 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      16th Nov 2007
You can only declare a collection object '"As Collection" or "As Object.
Thereafter, if fully declared, you will get the intellisense as pertains to
the collection object.

Depending on what you are doing and your needs, maybe you could use an array
of objects instead, eg

Private arrCls() As myClass

ReDim arrCls(1 to n)
Set arrCls(1) = new myClass
arrClss(1). after typing the dot you should get the intellisense

To destroy all objects in the array
Erase arrCls ' not necessary of arrCls is about to go out of scope

FWIW, if you are only adding, not 'removing' objects, I prefer to use an
array like this. Although string key is not available the 'index' of course
is.

Regards,
Peter T


"Ronald Dodge" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is there a way to declare a collection object as a collection of a
> particular type of object or as a collection of a particular class? Would
> like this for intellisense purposes.
>
> --
>
> Sincerely,
>
> Ronald R. Dodge, Jr.
> Master MOUS 2000
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding class object to collection repeats same object through collection? Erazmus Microsoft Excel Programming 2 17th Sep 2007 04:35 AM
Collection object fails within class FP1 Microsoft Access Form Coding 9 22nd Aug 2007 08:42 PM
"gridview Object does not match target type" error during binding collection of different type object gui.besse@gmail.com Microsoft ASP .NET 0 9th Mar 2006 10:28 AM
Casting a C# base class object to a derived class type. =?Utf-8?B?Q2hyaXMgQ2Fwb24=?= Microsoft C# .NET 5 3rd Jun 2005 11:35 PM
Problem in declaring a constant of user-defined (class) type Antony Microsoft VB .NET 3 25th Sep 2003 12:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:34 PM.