transparent .gif question

  • Thread starter Thread starter Deanna Delapasse
  • Start date Start date
D

Deanna Delapasse

Hi,

I've got some custom control buttons created with circular gif images. When
I place them on top of a panel using a .wmf file as its background I see the
form's color poking through the transparent corners of my buttons instead of
the pretty .wmf image.

Any ideas why that would happen?

thanks,
Deanna
 
The Transparent parts of a control show their Parent. It appears that you
have placed your buttons above the Panel instead of in it, making them
children of the Form and not the Panel.
 
That must be it, but can I set the controls INSIDE the panel using the
IDE? I know there's a parent property, but I don't see it in the VS
property window. Is there some way to do it when I drop the controls on
the panel?

thanks very much!
Deanna
 
Actually, I checked the .cs file and I think it IS putting the controls
in the panel. Any other thoughts on why the transparent area around the
buttons are showing the form's background and not the panel's? Code
from InitializeComponent is below.

thanks,
Deanna

// panel1
//
this.panel1.BackgroundImage =
((System.Drawing.Image)(resources.GetObject("panel1.BackgroundImage")));
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.gfRadioButton5);
this.panel1.Controls.Add(this.gfRadioButton3);
this.panel1.Controls.Add(this.gfRadioButton2);
this.panel1.Controls.Add(this.gfRadioButton1);
this.panel1.Controls.Add(this.gfButton2);
this.panel1.Controls.Add(this.gfButton1);
this.panel1.Location = new System.Drawing.Point(32, 8);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(416, 280);
this.panel1.TabIndex = 8;
 
Is gfRadioButton a control you authored yourself?
Have you placed
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
SetStyle(ControlStyles.Opaque, false);
in the controls Constructor?
 
Back
Top