Printing Children
How can I set my menu to print a child if it is open? If the child is not open, I don't want it to print. In fact, I want the print option disabled.
In the Click event of the parent menu (the one at the top, where you click to bring up the dropdown menu containing Print), add code to check the MdiChildren collection. If its length is 0, you know to disable the Print item:
Private Sub mnuFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFile.Click
mnuPrint.Enabled = (Me.MdiChildren.Length > 0)
End Sub
That should do it.
Except, of course (for those reading this later), it didn't--you need to use the Popup event, not the Click event, to get this to work correctly. (Just updating the thread for posterity... <g>)