i got a large picture box sent to the back with a default image.

i got a few picture boxes set to transparent and they are placed in front of that large picture box. these picture boxes have no images, just set to transparent in the properties.

I use the mousehover event on those picture boxes so when one is hovered over, it will change the image of the large picture box which is behind it.

the problem is that even though those picture boxes in front have been set to transparent, when the large picture box behind them loaps a new image due to an event, it doesnt show through those picture boxes which are in front of it!

any way to fix this? thanks

Recommended Answers

All 2 Replies

Hello

I found following from my software

public class WsPictureBox : PictureBox
    {
        public WsPictureBox()
        {

            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            UpdateStyles();

        }
    }

After that it should be possible to change backgroudcolor to transparent. Use new wspicture component instead. I have tried to use transparent components with DBEXform but implemented designer did not work well. There wss problems with update. Code should also be translated to VB.Net.

WSpicture component is in Willmansoft.com library distribute with DBEXform.

in every event of smaller picture boxes
add one if condition checking the
transparency state of the control first

if picturebox1.backcolor = color.transparent
then (code....)
else pictureboxBig.backroundimage = <the image you want to set
end if
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.