HighTechTalks DotNet Forums  

ControlCollection class

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss ControlCollection class in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Roger Garrett
 
Posts: n/a

Default ControlCollection class - 04-15-2005 , 01:21 PM






I can't seem to access the methods of the ControlCollection class.

I have a TabPage object: myTabPage;

I get the collection of controls for myTabPage by doing:

System.Windows.Forms.Control.ControlCollection collection
= myTabPage.get_Controls();

I then want to determine how many controls are in the collection, so I do
this:

int nNumberOfControls = collection.Count();

but the compiler says Count() is not a member of ControlCollection.

How do I get the count?

And assuming I can get that, how do I then get each of the controls within
the collection?

- Roger


Reply With Quote
  #2  
Old   
James Park
 
Posts: n/a

Default Re: ControlCollection class - 04-15-2005 , 06:06 PM






Try collection.get_Count() and collection.get_Item(index).
"Roger Garrett" <RogerGarrett (AT) discussions (DOT) microsoft.com> wrote

Quote:
I can't seem to access the methods of the ControlCollection class.

I have a TabPage object: myTabPage;

I get the collection of controls for myTabPage by doing:

System.Windows.Forms.Control.ControlCollection collection
= myTabPage.get_Controls();

I then want to determine how many controls are in the collection, so I do
this:

int nNumberOfControls = collection.Count();

but the compiler says Count() is not a member of ControlCollection.

How do I get the count?

And assuming I can get that, how do I then get each of the controls within
the collection?

- Roger




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.