I used a simpler approach. When you click on the menustrip icon, a small arrow appears in the upper-right-hand portion of the window. Click the arrow to open a menu properties window. You can set the visible properties to control what will be seen on the initial menu. You can also set or clear the visible attribute in code:
Public Sub MenuManage(Wayside As Integer, Vehicle As Integer, _
System As Integer, Tools As Integer, Reports As Integer, _
Edit As Integer, Zoom As Integer)
Main.WaysideToolStripMenuItem.Visible = Wayside
Main.VehicleToolStripMenuItem.Visible = Vehicle
Main.SystemToolStripMenuItem.Visible = System
Main.ToolsToolStripMenuItem1.Visible = Tools
Main.ReportsToolStripMenuItem.Visible = Reports
Main.EditToolStripMenuItem.Visible = Edit
Main.ZoomToolStripMenuItem.Visible = Zoom
End Sub
Within the Load and FormClosed event code, control what is seen on the menu:
Call MenuManage(True, True, True, True, True, False, False)