hi all,
my problem is that i have an MDI Parent form. it has lots of child forms. on my MDI Form i have the toolbar buttons Add, Delete and Save.
all or most of the child forms, i created a custom public procedure Sub AddNew, Sub Delete and Sub Save.
what i'm trying to do is when i click the AddNew in the MDI Form, it will run the custom public Sub AddNew of the currently ActiveMDIForm.
i have tried...
but i'm getting an error "Unable to cast object of type 'Form1' to type 'Form2'" if the currently ActiveMDIChild is not Form2.
can someone help me with this.
thanks
my problem is that i have an MDI Parent form. it has lots of child forms. on my MDI Form i have the toolbar buttons Add, Delete and Save.
all or most of the child forms, i created a custom public procedure Sub AddNew, Sub Delete and Sub Save.
what i'm trying to do is when i click the AddNew in the MDI Form, it will run the custom public Sub AddNew of the currently ActiveMDIForm.
i have tried...
VB.NET:
DirectCast(Me.ActiveMdiChild, Form2.AddNew()
but i'm getting an error "Unable to cast object of type 'Form1' to type 'Form2'" if the currently ActiveMDIChild is not Form2.
can someone help me with this.
thanks