Hello there,
I have three forms:
frmMain
,
frmLogin
and
frmPanel
.
When I run my program it shows
frmMain
which is an MDI container, and on load I open Login form as child.
Now when I login and information is correct I need to enable buttons on my
toolstrip1
which are disabled on load.
What I've tried is to make a function inside
frmMain
void functionOnForm1()
{
this.toolStripButton7.Enabled = true;
}
then on login form after password is OK I call this function:
((frmMain)this.MdiParent).functionOnForm1();
but I get the following error:
'Project1.frmMain.functionOnForm1()' is inaccessible due to its protection level (CS0122).
This is frmMain:
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
}
void functionOnForm1()
{
MessageBox.Show("ddd");
}
}
Does anybody know how to change property or labels from child on parent?