This documentation is archived and is not being maintained.
How to: Access Keyed Collections in Windows Forms
Visual Studio 2010
You can access individual collection items by key. This functionality has been added to many collection classes that are typically used by Windows Forms applications. The following list shows some of the collection classes that have accessible keyed collections:
The key associated with an item in a collection is typically the name of the item. The following procedures show you how to use collection classes to perform common tasks.
To find and give focus to a nested control in a control collection
To access an image in an image collection
Use the Item property to specify the name of the image you want to access.
To set a tab page as the selected tab
Use the SelectedTab property together with the Item property to specify the name of the tab page to set as the selected tab.
Show: