transparent control

B

bat21

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

thanks for all

bat21
 
A

a

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
 
E

Eric Eggermann

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
 

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