You cannot assign items directly to a collection, for example contextMenuStrip1.Items(2) = "Item2" , but you can do the same thing by adding items in order or using the insert and delete methods.
Dim item As New ToolStripMenuItem item.Text = "item B" contextMenuStrip1.Items.Insert(1, item) ' inserts "item B" before the second menu item. contextMenuStrip1.Items.Delete(contextMenuStrip1.Items(2)) ' deletes the third menu item
xpda source share