End Google Ads 201810 - BS.net 01 --> I have searched forums, Google, etc. and the examples provided do not work.
This is for a project I am working on.
The issue is creating event handler for click event
all else works and displays the pictureBoxes correctly

Code Snippet.

PictureBox pic = new PictureBox();
pic.Height = 150;
pic.Width = 150;
pic.Image = Utility.getPhoto(intPicID);

// get System.Drawing.Image from Picture Table
pic.******** = new System.Drawing.Point(intLeft, intTop);
pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
strBoxName = "PictureBox" + Convert.ToString(intW);
pic.Name = strBoxName;
pic.AllowDrop = true;
pic.TabStop = false;
pic.BorderStyle = BorderStyle.None;
if (clsGlobals.gbBorderStyle)
{
pic.BorderStyle = BorderStyle.Fixed3D;
}
//pic.Click += new System.EventHandler(pic_Click);
// if the preceeding line is un-commented the message
// the name pic_Click does not exist in the current context
clsGlobals.gstrPictureBoxNames[intW - 1] = pic.Name;
intW++;


PicBoxList.Add(pic);
}

// end of if
}

// end while

foreach (PictureBox pic in PicBoxList)
{
this.Controls.Add(pic);
//pic.Click += new System.EventHandler(pic_Click);
}


directives

using System;
using System.Windows;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using System.IO;
using System.Data.SqlClient;
using System.Web;