コード例 #1
0
        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);
            }
        }
コード例 #2
0
 private void bitmapViewer1_PictureSelected(object sender, PictureSelectedEventArgs e)
 {
     MessageBox.Show("You chose " + e.FileName);
 }