Beispiel #1
0
        private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
            PictureBox source = (PictureBox)sender;

            if (source.Image != null)
            {
                picBox.Close();
                picBox.Dispose();
                picBox = null;
            }
        }
Beispiel #2
0
        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
            picBox = new picBoxForm();
            PictureBox source = (PictureBox)sender;

            if (source.Image != null)
            {
                foreach (PictureBox c in picBox.Controls)
                {
                    if (c.Name == "pic1")
                    {
                        c.Image = source.Image;
                    }
                    else if (c.Name == "pic2")
                    {
                        c.Image = pictureBoxMain.Image;
                    }
                }
                picBox.Show(this);
            }
        }