nickslick 0 Newbie Poster

![Hi Daniweb forum, I've come across a problem in my panel_mousedown event. Now I initially have 3 pictureboxes Painted on panel1, and each picturebox Control is set to Visible = false; and only become visible again when using this code:

private void panel1_MouseDown(object sender, MouseEventArgs e)
        {
            if (picturebox1.Bounds.Contains(e.Location) && !picturebox1.Visible)
            {
                picturebox1.Show();
                picturebox2.Hide();
                picturebox3.Hide();
            }

            if (picturebox2.Bounds.Contains(e.Location) && !picturebox2.Visible)
            {
                picturebox1.Hide();
                picturebox2.Show();
                picturebox3.Hide();
            }

            if (picturebox3.Bounds.Contains(e.Location) && !picturebox3.Visible)
            {
                picturebox1.Hide();
                picturebox2.Hide();
                picturebox3.Show();
            }

The problem I have faced while using this code is that when there are overlapping picturebox images, when I click one it may click the image Behind it, like so in my attached image.

I would really appreciate any help you give me, thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.