You need to do something like:
private void frmMDIMain_Load(object sender, System.EventArgs e)
{
Form frmLogin = new frmLogin();
frmLogin.Closing += new
System.ComponentModel.CancelEventHandler(this.frmLogin_Closing);
frmLogin.ShowDialog();
}
private void frmLogin_Closing(object sender,
System.ComponentModel.CancelEventArgs e)
{
panel5.Visible = true;
button1.Visible = true;
panel6.Visible = true;
dataGrid1.Visible = true;
}
frmLogin.Closing += new ClosingHan
> using C# VS2003
>
[quoted text clipped - 18 lines]
> reference... There must be something I'm missing any help would be
> great.
rhaazy - 20 Jul 2006 13:36 GMT
I have no idea whats going on here. If you could explain a bit more
how this is going to help me with my problem maybe I can get it
working. Making chose changes doesn't get me any closer, if anything
the compiler just throws more errors..
> You need to do something like:
>
[quoted text clipped - 38 lines]
> > reference... There must be something I'm missing any help would be
> > great.
Pritcham - 21 Jul 2006 08:59 GMT
Hi
I'm assuming that the code you originally listed in your post was from
the 2 forms (i.e. the 'private void frmMDIMain_Load' sub was in your
frmMDIMain's code, and the 'private void frmLogin_Closing' code was in
your frmLogin code?
The above poster basically 'moved' the code from frmLogin into your
frmMDIMain form and added an event listener which responds to the
frmLogin closing event and fires the sub accordingly. This way you're
not having to reference the main form from your login form. Hope that
makes sense.
Martin
> I have no idea whats going on here. If you could explain a bit more
> how this is going to help me with my problem maybe I can get it
[quoted text clipped - 42 lines]
> > > reference... There must be something I'm missing any help would be
> > > great.
rhaazy - 21 Jul 2006 13:37 GMT
Hey I got it now, thanks a lot!
> Hi
>
[quoted text clipped - 10 lines]
>
> Martin