Picturebox: transparent background

sollniss

Member
Joined
Aug 5, 2008
Messages
12
Programming Experience
3-5
I have the problem, that, if I put an icon into a picturebox the icon isn't transparent anymore (because I must convert it to BMP). But it needs to because under the picturebox is a label and if the picture in the picbox isn't transparent the label can't be read.

I need to do something like this:
VB.NET:
        picError.Image = SystemIcons.Error ' without .ToBitmap
        ' picError.BackColor = Color.Transparent

BTW. The label and the picbox can't be moved.
 
This seems to be a common complaint. Here's how I do it.
Put your image in an ImageList.
Set the ImageList TransparentColor to match your image.
Load your PictureBox Image from the ImageList.
 
Back
Top