preventing a form from closing
-
1. When a button is clicked on Form1 it handles the event by creating a new form, like this: newForm *a=new newForm; a.Show(); the problem here is that when Form1 is closed newForm disspaears is closed too. how can a new a form be closed without closing all the forms it created? 2. in the above example newForm also has a button that creates an instance of Form1 when pressed. Form1.h has newForm.h included. the problem here is that when i try to include Form1.h in newForm.h i get an error saying that newForm is not defined in Form1 and Form1 is not defined in newForm.h. m$: It is normal for your screen to go blank and for your computer to restart itself several times
-
1. When a button is clicked on Form1 it handles the event by creating a new form, like this: newForm *a=new newForm; a.Show(); the problem here is that when Form1 is closed newForm disspaears is closed too. how can a new a form be closed without closing all the forms it created? 2. in the above example newForm also has a button that creates an instance of Form1 when pressed. Form1.h has newForm.h included. the problem here is that when i try to include Form1.h in newForm.h i get an error saying that newForm is not defined in Form1 and Form1 is not defined in newForm.h. m$: It is normal for your screen to go blank and for your computer to restart itself several times
-
to close form1 i call form1.dispose(); that in turn calls components.dispose(); i dunno where to find the OnClosing event anyway setting form1.cancel to false will still close the form whiel allowing it's chold forms to exist? i mean really lose it not just hide it. what about calling Activator.CreateInstance(newForm); i've seen soem refereances to the functione but i have no clue as to what it does. m$: It is normal for your screen to go blank and for your computer to restart itself several times -- modified at 9:33 Friday 30th December, 2005
-
1. When a button is clicked on Form1 it handles the event by creating a new form, like this: newForm *a=new newForm; a.Show(); the problem here is that when Form1 is closed newForm disspaears is closed too. how can a new a form be closed without closing all the forms it created? 2. in the above example newForm also has a button that creates an instance of Form1 when pressed. Form1.h has newForm.h included. the problem here is that when i try to include Form1.h in newForm.h i get an error saying that newForm is not defined in Form1 and Form1 is not defined in newForm.h. m$: It is normal for your screen to go blank and for your computer to restart itself several times
I do not think there is a way to close a parent form and keep its child forms open. Darryl Borden Principal IT Analyst dborden@eprod.com
-
I do not think there is a way to close a parent form and keep its child forms open. Darryl Borden Principal IT Analyst dborden@eprod.com