I have 2 Forms in my project. Form1 is the main Form. There I have a button to open Form2, a ListView and a method to call a url and feed the ListView with data it gets from the url.
Form2 has a textbox for the url and a button "Ok".
When I press the button on Form1, it opens Form2, no problem. How can I manage it to pass the url to the method in Form1 if I enter a url into the textbox of Form2 and press Ok?
if I do
Form1 form1 = new Form1();
form1.method();
it will obviously open a new instance of Form1, execute the method there and fill the listbox there but not on my original Form1.
I found various solutions to the problem online but either they were too complicated or they didn't work.
How can I put it that it actually executes the method on the Form1 that I already have and therefore load the correct listbox with the values?
Many thanks