foreach(System.Windows.Forms.MenuItem oMI in this.mnuNetworkAdapters.MenuItems) { oMI.Checked = false; }which I could convert to a for loop like this:
for (int i = 0 ; i < this.mnuNetworkAdapters.MenuItems.Count ; i++) { this.mnuNetworkAdapters.MenuItems[i].Checked = false; }But this is the problem I have to loop though all the menu items in the particular "branch" and compare the Text property unless I know what order I put them in. In my case I have a collection of NetworkAdapter objects, which is what I use to populate the menu items so based on the "index" of the checked menu item I can reference the object in my collection of network adapters.