title: Click event handelr inside a loop
body: <p>I have called my clickevent inside a for loop, but as I click my
   PictureBox in this case, for it to open in new form, the click event is
   repeated multiple times, multiple new forms keeps on opening</p>
  
  <pre><code>imagename= myRow["Photo"].ToString();
  imagepath = imagename.Split(splitchar, StringSplitOptions.RemoveEmptyEntries);
   for (int j = 0; j &lt;= imagepath.Length-1;j++ )
   { 
       if(imagepath[j]!=null){
  
           string imagefinals = paths + imagepath[j];
           pics[j].ImageLocation = imagefinals;
           pics[j].SizeMode = PictureBoxSizeMode.StretchImage;
           pics[j].Click += new System.EventHandler((s, ee) =&gt; LoadImage(s, e, imagefinals));
       }
   }
   return;
  </code></pre>