Child form enables menu toolbar on main form?

Jnox

Active member
Joined
Apr 19, 2006
Messages
25
Programming Experience
Beginner
Solved, Scroll for solution!





Originial Question:

Is this possible to do. Here is how my program is set up.

user logs in on the child form. If log in is correct, the child form enables two menu bars on the main form then closes.

How do I send a command from child form to main form to execute specific code/sub?

I know how to pass data between forms, thats not an issue, but from what I've tried it only works for passing data and not enabling menus!

HELP!

Thank you!
 
Last edited:
I figured it out!

I've been strugling with this all day!

Here is the solution for anyone that cares:

Main form code:
VB.NET:
Friend Sub LoadMenus(ByVal MenuPermissive As Boolean)
 
Dim Blah As Boolean
 
Blah = MenuPermissive
If Blah = True Then
MessageBox.Show("Test! IT WORKS!", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Information)
 
Me.ToolStrip1.Visible = False
 
End If
 
End Sub
 
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim form As New Form2
'form.MdiParent = Me
form.Show()
End Sub
Child form code:
VB.NET:
Public Shared MenuPermissive As Boolean
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MenuPermissive = True
'Dim AccessMenu As New Form1
Form1.LoadMenus(MenuPermissive)
End Sub
 
Last edited by a moderator:
Back
Top