(newbie) How to enable/disable button?

  • Thread starter Thread starter TomislaW
  • Start date Start date
T

TomislaW

How can I enable/disable button on mdi parent form when I click on some
control in activ child form?
 
* "TomislaW said:
How can I enable/disable button on mdi parent form when I click on some
control in activ child form?

\\\
DirectCast(Me.MdiParent, MainForm).Button1.Enabled = False
///
 
I work in C# and I wrote
((Form1)this.Parent).btnNew.Enabled = false;

I can not access Button1 in parent
 
when I declare button of parent form as public I get:
"An unhandled exception of type 'System.InvalidCastException' occurred in
xy.exe"

Additional information: Specified cast is not valid.
TomislaW said:
I work in C# and I wrote
((Form1)this.Parent).btnNew.Enabled = false;

I can not access Button1 in parent
 
* "TomislaW said:
I work in C# and I wrote
((Form1)this.Parent).btnNew.Enabled = false;

\\\
((Form1)this.MdiParent).btnNew.Enabled = false;
///
 
Back
Top