I have two Forms, Form1(main form) and Form2. Form 1 displays images files, pdf conversion, etc. But If user want to view Zip files, Form2 is called displaying a preview of all the Zip files available on a listView. If user selects a particular Zip file on Form2, the file is unzipped and image files sent to Form2. But I dont know how to refresh Form2 from Form1. By the way all the images from Form2 are now present in the variable list in Form! to be displayed but the form did not update.
form2 code:
private void btn_read_Click(object sender, EventArgs e)
{
Form1 f1 = new Form1();
f1.ReadArchives(Filepath); //this function creates the image files on Form1
this.Close(); //close form2
for (int index = Application.OpenForms.Count - 1; index >= 0; index--)
{
if (Application.OpenForms[index].Name == "Form1")
{
//Application.OpenForms[index].Close();//EFFECTIVE BUT CLOSES THE WHOLE APPLICATION
Application.OpenForms[index].Invalidate(); //no effect
Application.OpenForms[index].Refresh();//no effect
Application.OpenForms[index].Update();//no effect
Application.OpenForms[index].Show();//no effect
}
}
}