Picturebox as a container

G

Guest

Is there a way in VB.NET to use a PicureBox as a container like in VB 6? I have an image that I want to place in a container and have transparent labels "float" on top of the image and use them as buttons. In VB 6, I used a PictureBox and that worked fine. In VB.NET, the labels background shows the same as the forms backcolor, not whatever color the image is behind it. I ran the conversion wizard to convert the project to VB.NET and it replaced the PictureBox with a Panel. The panel has a BackgroundImage property, but that shrinks the image and displays a bunch of them. Is there another container that will accomplish what I want?

Thanks!
 
K

Ken Tucker [MVP]

Hi,

When you set a controls background to transparent it takes the color
of it parent. Set the labels parent to the picturebox. Of course you will
have to reposition the labels.

Ken
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?V2FkZQ==?= said:
labels background shows the same as the forms backcolor, not whatever
color the image is behind it. I ran the conversion wizard to convert
the project to VB.NET and it replaced the PictureBox with a Panel. The
panel has a BackgroundImage property, but that shrinks the image and
displays a bunch of them. Is there another container that will

Are you sure the image is shrinked? It's tiled, but not shrinked.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top