|
Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
|
Tradução
Original
|
Método Menu.MenuItemCollection.CopyTo
Assembly: System.Windows.Forms (em System.Windows.Forms.dll)
Parâmetros
- dest
- Tipo: System.Array
Matriz de destino.
- index
- Tipo: System.Int32
O índice na matriz de destino no qual armazenar começa.
Implementações
ICollection.CopyTo(Array, Int32)
privatevoid CopyMyMenus()
{
// Create empty array to store MenuItem objects.
MenuItem[] myItems =
new MenuItem[menuItem1.MenuItems.Count + menuItem2.MenuItems.Count];
// Copy elements of the first MenuItem collection to array.
menuItem1.MenuItems.CopyTo(myItems, 0);
// Copy elements of the second MenuItem collection, after the first set.
menuItem2.MenuItems.CopyTo(myItems, myItems.Length);
// Add the array to the menu item collection of the ContextMenu.
contextMenu1.MenuItems.AddRange(myItems);
}
Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
o.NET Framework e.NET Compact Framework não oferecem suporte a todas as versões de cada plataforma. Para obter uma lista de versões suportadas, consulte Requisitos de sistema do .NET framework.