I'm not clearly understand your problem but try to get some idea with this, hope this would help.
your trying to disable some menus and in the MdiParent whether the form is child or not.
in the main form:
VB Code:
' MenuItem2 used to open Form2 as child of Form1
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
Dim frm2 As New Form2
frm2.MdiParent = Me
frm2.Show()
End Sub
'Sample Public
Public Sub hello()
MessageBox.Show("hello world")
End Sub
' MenuItem3 used to open Form3 not a child of Form1
Private Sub MenuItem3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
Dim frm3 As New Form3
Me.AddOwnedForm(frm3)
frm3.Show()
End Sub
in your form2:
VB Code:
Dim frmMain As Form1 ' Form1 is the MdiParent
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
frmMain = DirectCast(Me.MdiParent, Form1)
frmMain.MenuItem2.Enabled = False ' disable the menu(MenuItem2) from the Form1 which is the MdiParent
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
frmMain.hello() ' access sample public sub in the Form1 which is the MdiParent
End Sub
in your form3:
VB Code:
Dim frmMain As Form1 ' Form1 is the MdiParent
Private Sub Form3_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
frmMain = DirectCast(Me.Owner, Form1) ' frmMain is the owner of this form(Form3)
frmMain.MenuItem3.Enabled = False ' disable menu(MenuItem3) from the MdiParent
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
frmMain.hello()
End Sub
:bigyello: