for (int i = 0; i < client.Folders.Count; i++)
{
(ContextMenuListView.Items[1] as ToolStripMenuItem).DropDownItems.Add(client.Folders[i].Name);//add Folder to Move To
(ContextMenuListView.Items[2] as ToolStripMenuItem).DropDownItems.Add(client.Folders[i].Name);
}
how to I get subitem in Items[1] or Items[2] ?
ToolStripItemCollection.Add(string)(DropDownItems.Add()) will return the new ToolStripItem …on the other hand, all other sub items are referenced by the
ToolStripItemCollection DropDownItemsso the easy way to get the two created items is:
would become:
or to access all sub items:
or to access a specific sub item: