internal static void dataGridViewFriends_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { DataGridView senderDataGridView = (DataGridView)sender; if (senderDataGridView.Tag.Equals(k_PhotosGridTag)) { UserRank<Photo> userInfo = (UserRank<Photo>)senderDataGridView.Rows[e.RowIndex].Cells[2].Value; ImagesForm userSharedTaggedImagesForm = new ImagesForm(); userSharedTaggedImagesForm.Text = string.Format("{0} Shared Photos", userInfo.Name); foreach (Photo photo in userInfo.GetObjectList()) { userSharedTaggedImagesForm.AddImageToGrid(photo); } userSharedTaggedImagesForm.Show(); } else { UserRank<Event> userInfo = (UserRank<Event>)senderDataGridView.Rows[e.RowIndex].Cells[2].Value; UserSharedEventsForm userSharedEventsForm = new UserSharedEventsForm(); userSharedEventsForm.Text = userInfo.Name; userSharedEventsForm.SetUserDetails(userInfo); userSharedEventsForm.Show(); } } }
private void pictureBox_Click(object sender, EventArgs e) { PictureBox senderPictureBox = (PictureBox)sender; string url = senderPictureBox.Name; ImagesForm bigPictureForm = new ImagesForm(); bigPictureForm.SingleImageToShow(url); bigPictureForm.Text = string.Empty; bigPictureForm.Show(); }