-
Apr 18th, 2021, 01:06 PM
#1
Thread Starter
Lively Member
[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.
-
Apr 18th, 2021, 02:01 PM
#2
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
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|