kblair
Member
- Joined
- Feb 11, 2010
- Messages
- 8
- Programming Experience
- 1-3
I have routine that I use to turn off all of the check marks on various menus. The code works fine as long as there are no menu seperators.
How do ignore the seperators that are of the wrong type and contiue unchecking the rest of the items? I have tried on error resume next but it still drops out of the for each loop so that only the items above the seperator are un-checked.
Thanks for your help,
Kent
VB.NET:
Private Sub ClearMenuChk()
Dim mnuItm As ToolStripMenuItem
For Each mnuItm In mnuZoom.DropDownItems
mnuItm.Checked = False
Next
For Each mnuItm In mnuAnnotation.DropDownItems
mnuItm.Checked = False
Next
For Each mnuItm In mnuAnnotRubStamps.DropDownItems
mnuItm.Checked = False
Next
End Sub
How do ignore the seperators that are of the wrong type and contiue unchecking the rest of the items? I have tried on error resume next but it still drops out of the for each loop so that only the items above the seperator are un-checked.
Thanks for your help,
Kent