Transparent Control is opaque

R

ralphsieminsky

A form has a background image. On that
form there is a button. Partially overlapping
that button is a class derived from Control,
with only one customization: it makes its background
transparent in the constructor, using this technique:
http://msdn2.microsoft.com/library/wk5b13s4.aspx

BringToFront was called on the transparent
control.

What one can see in the region where the
transparent control and the button overlap
is the background image of the form.

Why isn't the part of the button overlapped
by the transparent control shown instead of
the background image ?

Thanks,
Ralph
 
K

Ken Tucker [MVP]

Hi,

A transparent control takes the backgound of it parent. So if you
place a transparent label over a picture box the labels background will be
the same as the forms. Make sure the transparents controls parent is the
control whos background you want to see under the transparent control.

Ken
--------------------------------
A form has a background image. On that
form there is a button. Partially overlapping
that button is a class derived from Control,
with only one customization: it makes its background
transparent in the constructor, using this technique:
http://msdn2.microsoft.com/library/wk5b13s4.aspx

BringToFront was called on the transparent
control.

What one can see in the region where the
transparent control and the button overlap
is the background image of the form.

Why isn't the part of the button overlapped
by the transparent control shown instead of
the background image ?

Thanks,
Ralph
 

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