Dotnet Dotnet - 29 days ago 6
C# Question

WinForms opening the same form multiple times

I have a requirement to open up the same form multiple times when looping. I am not using any MDI from so is there is any possibility to show the same

foreach (string report in lstReports)
{
PrintForm print = new PrintForm();
print.FillReport(dt, report);
print.ShowDialog();
}


This code is opening up the same form when I close the previous one, what I need is I need to show the same form instance multiple times

Answer

Try using the Show() method instead of ShowDialog(). That should do the trick.