for (int i = 0; i < FtnList.BACHModuleList.Count; i++)
{
PictureBox pb = new PictureBox();
Point pbLocation = new Point(HS + (i + 1) * 100 - 250, PicVS);
pb.Width = 65;
pb.Height = 65;
pb.BackColor = Color.FromArgb(105, 164, 194);
pb.Location = pbLocation;
pb.Name = "pic" + FtnList.BACHModuleList[i].Name;
pb.BackgroundImage = Properties.Resources.Arrow_Right;
pb.Click += pictureBox0_Click;//new System.EventHandler(pictureBox0_Click);
pb.Click += pictureBox1_Click;//new System.EventHandler(pictureBox1_Click);
this.Controls.Add(pb);
<hr/>
<hr/>
<hr/>
private void pictureBox0_Click(object sender, System.EventArgs e)
{
}
红线那段,究竟该怎么写?跪求指导!
pb.Click += new System.EventHandler(pictureBox0_Click);
pb.Click += new System.EventHandler(pictureBox1_Click);
按你的 pb.Click 绑定,肯定是会触发两次,你说的重复赋值不知何意?