I have a main form with a list of data inside a listBox. When I click the button, I open a new form to create a new data object (the main form is inactive in the background), when new data is transferred to the listobox inside the main form, it must be filled with this new object.
I thought the following:
- When Form2 was submitted, I thought to find an instance of MainForm and kill this instance, after which it should be easy, load the list of data from db again and display it in the list.
Question:
If Form1 is created and at some event Form2 is created using showDialog, so Form1 is inactive until the data is presented, how can I find an instance of Form1 before closing Form2?
So how to find an instance of class Form1 from class Form2?
thanks
panjo source share