tags:

views:

500

answers:

2

The question pretty much says it all, I've tried setting the backcolour to transparent in the properties section, but it didnt seem to work. I have a picture behind the groupbox that I need to show through it. Is there a specific way of doing this?

Thanks

A: 

If you are looking for a WPF solution, try the following. Make sure to set Window.AllowsTransparency to true

<Window 
    AllowsTransparency="True" />

    <GroupBox Background="Transparent" />
</Window>
JaredPar
+3  A: 

The transparent property doesn't work for overlapping controls. I guess that you have your picture in a PictureBox?

You can fix this in at least two ways:

1) perhaps the easiest is to place both your picture AND GroupBox within a Panel (you set the Panel's BackgroundImage property). That will work. Then the GroupBox and Panel aren't technically overlapping, but the GruopBox is a child to the Panel. That requires no code and you see exactly what you get directly in the Forms Designer.

2) Paint the picure directly onto the form yourself in in one of the form's OnPaint or OnPaintBackground methods.

danbystrom
Thanks for the help! My form looks much better now =D