private void pic_Click(object sender, System.EventArgs e) { // Clear the border style from the last selected picture box. if (picSelected != null) { picSelected.BorderStyle = BorderStyle.FixedSingle; } // Get the new selection. picSelected = (PictureBox)sender; picSelected.BorderStyle = BorderStyle.Fixed3D; // Fire the selection event. PictureSelectedEventArgs args = new PictureSelectedEventArgs((string)picSelected.Tag, picSelected.Image); if (PictureSelected != null) { PictureSelected(this, args); } }
private void bitmapViewer1_PictureSelected(object sender, PictureSelectedEventArgs e) { MessageBox.Show("You chose " + e.FileName); }