Re-enable my toolbar button again...

  • Thread starter Thread starter The_Coolest_Dolphin
  • Start date Start date
T

The_Coolest_Dolphin

Hi C# wizards,


I would like to ask you the following question:


I'm working on a program with a mainform (a mdiParent called frmMain) and a
childform (called frmNieuwk).
I use the library from CommandBar that gives me the new Luna look from
Micros$oft, so that gives me a toolbar + menubar with several buttons.

Situation is as follows:

When I click on my button newclientButton follwing happens:

private void frmNieuwk_Click(object sender, EventArgs e)
{
frmNieuwk Nieuwe_Klant = new frmNieuwk();
Nieuwe_Klant.MdiParent = this;
Nieuwe_Klant.Show();
this.nklantButton.IsEnabled = false; // <--- this is
the button I spoke about
}

This shows my new client form and disables the button in my toolbar in the
mainform. But now when I close my new client form I also want to enable the
button again. But how? I just cannot access the toolbarbuttons properties
anymore from my clientform. I just wonna enable the button again :-s

I know it's a rather newbie question but I really need help with this. Why
o why did I ever started with VB6 instead of C.... :-(

Any ideas? Help would be appreciated bigtime !
 
in the Closed event of the child form you can do something like this:

(frmMain)(this.MdiParent).nklantButton.IsEnabled = true;
 
oops, it's my fault, the parenthesis are at the wrong place:

((frmMain)this.MdiParent).nklantButton.IsEnabled = true;

should work
 
oops, it's my fault, the parenthesis are at the wrong place:

((frmMain)this.MdiParent).nklantButton.IsEnabled = true;

should work


It does work !! ;-)

What would the world be without guys & girls like you sharing their
knowledge with everybody...

Thank you very much!
 
Back
Top