By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,344 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,344 IT Pros & Developers. It's quick & easy.

Convert a collection to an array

P: n/a
Hello!

Is there any simple onerowcode to convert a collection to an array?
For example I have two separate tabcontrols with several tabpages.
I want to use Tabcontrol1 but add all tabpages from Tabcontrol2 to this.
I tried with TabControl1.TabPages.AddRange(Tabcontrol2.TabPages ) but this don't work.

Regards Magnus

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Magnus" <ma*************@mikla.nu> schrieb

Is there any simple onerowcode to convert a collection to an array?
For example I have two separate tabcontrols with several tabpages.
I want to use Tabcontrol1 but add all tabpages from Tabcontrol2 to this.
I tried with TabControl1.TabPages.AddRange(Tabcontrol2.TabPages ) but this
don't work.

=======

The type of System.Windows.Forms.TabControl.TabPages is
System.Windows.Forms.TabControl.TabPageCollection. It implements the
System.Collections.ICollection interface. The interace has a CopyTo method
you can use to copy the tabpages to an array to be passed to AddRange.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

P: n/a


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.