I am changing the picture in panel2 in main form. When I change the image, I want the image in the main form to change at the same time. I tried many things, but I cannot reload the main form when closing the subform. Therefore, the previous picture in panel2 is visible. Do you have an opinion on this?

Mehmet FatihPosted Jul 11, 2023, 10:50 AM
It gives some errors. It is not working.
Mohamed Azarudeen ZPosted Jul 10, 2023, 1:00 PM
Hi Mehmet
In the main form, create a public method or property that allows other forms to update the image. For example, you can create a method called
UpdateImagethat takes an image as a parameter and updates the image in the panel.In the subform, add a reference to the main form so that you can access its public methods and properties. You can achieve this by passing the instance of the main form to the constructor of the subform.
hope this helps