private void PictureBox1Click(object sender, EventArgs e) { ShowPictureForm showPictureForm; if (sender is PictureBox) { if (((PictureBox)sender).Name == "pictureBox1") { showPictureForm = new ShowPictureForm(_corporate, this, 0); showPictureForm.ShowDialog(); } else if (((PictureBox)sender).Name == "pictureBox2") { showPictureForm = new ShowPictureForm(_corporate, this, 1); showPictureForm.ShowDialog(); } } else if (sender is LinkLabel) { switch (((LinkLabel)sender).Name) { case "linkLabelChangePhoto": showPictureForm = new ShowPictureForm(_corporate, this, 0); showPictureForm.ShowDialog(); break; case "linkLabelChangePhoto2": showPictureForm = new ShowPictureForm(_corporate, this, 1); showPictureForm.ShowDialog(); break; } } }
private void pictureBox_Click(object sender, EventArgs e) { int photoSubId = 0; if (sender is PictureBox) { if (((PictureBox)sender).Name == "pictureBox2") { photoSubId = 1; } else if (((PictureBox)sender).Name == "pbSignature") { photoSubId = 2; } } else if (sender is LinkLabel) { if (((LinkLabel)sender).Name == "changePhotoLinkLabel2") { photoSubId = 1; } else if (((LinkLabel)sender).Name == "changeSignatureLinkLabel") { photoSubId = 2; } } ShowPictureForm showPictureForm = new ShowPictureForm(_tempPerson, photoSubId, this); showPictureForm.ShowDialog(); }
private void pictureBox1_Click(object sender, EventArgs e) { int photoSubId = 0; if (sender is PictureBox) { if (((PictureBox)sender).Name == "pictureBox2") { photoSubId = 1; } } ShowPictureForm showPictureForm = new ShowPictureForm(_village, this, photoSubId); showPictureForm.ShowDialog(); }
private void changePhotoLinkLbl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { int photoSubId = 0; if (sender is LinkLabel) { if (((LinkLabel)sender).Name == "linkLabelChangePhoto2") { photoSubId = 1; } } ShowPictureForm showPictureForm = new ShowPictureForm(_village, this, photoSubId); showPictureForm.ShowDialog(); }
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { int photoSubId; if (((LinkLabel)sender).Name == "changePhotoLinkLabel") { photoSubId = 0;//it means that we want to get 1st picture } else { photoSubId = 1;//it means that we want to get 2nd picture } ShowPictureForm pictureForm = new ShowPictureForm(Person, photoSubId, this); pictureForm.ShowDialog(); }