I am having trouble communicating with my mdiParent from a child form. I am trying enable some menu items on the mdi parent when a user logs in successfully in frmLogin. I am able to pass info to setPermissions(bool enabled) and I step through the code and it shows that each menu item's enabled property is changed to true but when I go up to the menu again they are still not enabled. what should i do?
this code is in the parent:
public void setPermissions(bool access)
{
this.mnuLogon.Enabled = !access;
this.mnuLogout.Enabled = access;
this.mnuSpending.Enabled = access;
this.mnuCurrent.Enabled = access;
this.mnuTransactions.Enabled = access;
this.mnuDebt.Enabled = access;
}
this is the code in the child:
private void cmdOK_Click(object sender, System.EventArgs e)
{
int login = data.login(txtLogin.Text.ToString(), txtPassword.Text.ToString());
switch(login)
{
case 0:
MessageBox.Show("Invalid Login Name or Password");
txtLogin.Focus();
break;
case 1:
frm.setPermissions(true);
this.Hide();
break;
case 2:
frm.setPermissions(true);
this.Hide();
break;
default:
MessageBox.Show("Invalid Login Name or Password");
txtLogin.Focus();
break;
}
}
am i missing something obvious? I am fairly new to C#.
Thanks,
Pete