DustinHinkel
asked on
Need to fire event on form close
in vb.net 2005 . I have two forms open, form1 and form2, is there a way to fire an event on form1 when form2 closes?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Form2 is opened from a command click from Form1, but not created from form1 if I understand you right. Fairly new to this. How do i "subscrive to Form2's closing event?
See above... ;)
ASKER
Thanks that worked. But when I put the code in my project i get an error going in design view. It says:
One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.
The type Form1 is made of several partial classes in the same file.
Hide
at System.ComponentModel.Desi gn.Seriali zation.Cod eDomDesign erLoader.E nsureDocum ent(IDesig nerSeriali zationMana ger manager)
at System.ComponentModel.Desi gn.Seriali zation.Cod eDomDesign erLoader.P erformLoad (IDesigner Serializat ionManager manager)
at Microsoft.VisualStudio.Des ign.Serial ization.Co deDom.VSCo deDomDesig nerLoader. PerformLoa d(IDesigne rSerializa tionManage r serializationManager)
at System.ComponentModel.Desi gn.Seriali zation.Bas icDesigner Loader.Beg inLoad(IDe signerLoad erHost host)
One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.
The type Form1 is made of several partial classes in the same file.
Hide
at System.ComponentModel.Desi
at System.ComponentModel.Desi
at Microsoft.VisualStudio.Des
at System.ComponentModel.Desi
Not sure what you did...
Make sure you have only ONE declaration for each form:
Public Class Form1
...
End Class
Public Class Form1
...
End Class
So in the above example, move everything from the second "Form1" class up into the first, and get rid of the second "Form1" class declaration. Other than that, I'm not sure...
Make sure you have only ONE declaration for each form:
Public Class Form1
...
End Class
Public Class Form1
...
End Class
So in the above example, move everything from the second "Form1" class up into the first, and get rid of the second "Form1" class declaration. Other than that, I'm not sure...
ASKER
Sorry, I'm an idiot. Learning would be impossible without people like you. Thanks
Does Form1 create Form2?