transparent control

  • Thread starter Thread starter bat21
  • Start date Start date
B

bat21

How create transparent background in "UserControl" ( Opacity regulated ) ?

thanks for all

bat21
 
In the link you provided, step one says: "In the Code Editor for your
control, locate the constructor." I am trying to make a pictureBox be
tranparent. How do I get to the contructor for the pictureBox?

I tried doing this inside InitializeComponent(), but I get the error:

Cannot access protected member
'System.Windows.Forms.Control.SetStyle(System.Windows.Forms.ControlStyles,
bool)' via a qualifier of type 'PictureBox'; the qualifier must be of type
'Form1' (or derived from it)

Thanks
 
a said:
In the link you provided, step one says: "In the Code Editor for your
control, locate the constructor." I am trying to make a pictureBox be
tranparent. How do I get to the contructor for the pictureBox?

I tried doing this inside InitializeComponent(), but I get the error:

Cannot access protected member
'System.Windows.Forms.Control.SetStyle(System.Windows.Forms.ControlStyles,
bool)' via a qualifier of type 'PictureBox'; the qualifier must be of type
'Form1' (or derived from it)

Thanks

You can only locate the constructor if you are deriving a new class from
PictureBox.

Try setting the back color of the picture box to Transparent. Open the Forms
designer, click the picture box, then in the properties window click on
BackColor. On the Web tab, click on Transparent. It's the first item in the
list on my machine. Maybe that is what you want.

HTH
Eric
 
Back
Top