I have a parent form with a strip menu called topMenu
.
I have a child form called "SignIn" and when a user is logged in then I want to disable the topMenu.item.logIn
and enable topMenu.item.Logout
.
How Can I disable the topMenu
of the parent container from the child form?
When a user clicks in the strip menu item "Sign In" the following code is executed.
private void signInToolStripMenuItem_Click(object sender, EventArgs e)
{
var newMDIChild = new SignIn();
// Set the Parent Form of the Child window.
newMDIChild.MdiParent = this;
newMDIChild.Dock = DockStyle.Fill;
// Display the new form.
newMDIChild.Show();
}
after a user type the username and the password the following code is executed
public partial class SignIn : Form
{
public SignIn()
{
InitializeComponent();
}
private void btn_signin_Click(object sender, EventArgs e)
{
UserInfo.Autherized = true;
// here I want to disable the sign in menu item
// and enable the sign out menu item which is located on the parent form
this.Close();
}
}