[RESOLVED] Tell Form1 that Form2 is closed
I have a complicated question about two forms.
Form1 contains a Listview with document names. I click a button which opens Form2. In Form2 I show duplicate documents. When I click OK these duplicates are deleted. The Form2 is then closed.
When I return to Form1 I want the Listview updated. So clear it and add the documenst which were left (not deleted).
How does Form1 know that Form2 was closed and thus the Listview should be updated?
Breaking my head.
Re: [RESOLVED] Tell Form1 that Form2 is closed
Instead of showing Form2 using the .Show method, use the .ShowDialog method, as that will cause the code in Form1 to pause while Form2 is visible (you can put the code to update the listview just after the ShowDialog call).
Documentation for ShowDialog:
https://docs.microsoft.com/en-us/dot...g?view=net-5.0