transparent usercontrol

N

Norvin Laudon

Hi,

I'm making a usercontrol, portions of which are transparent. How can I
determine the color of the parent container, so I can pass it to a
MakeTransparent(Color) method?

For example, if somebody is placing this control on a panel object, how do I
obtain the BackColor property of the panel?

For usercontrols, the "Parent" property seems to be null, it throws
exceptions when I try to use it.

Norvin
 
H

Herfried K. Wagner [MVP]

* "Norvin Laudon said:
I'm making a usercontrol, portions of which are transparent. How can I
determine the color of the parent container, so I can pass it to a
MakeTransparent(Color) method?

For example, if somebody is placing this control on a panel object, how do I
obtain the BackColor property of the panel?

For usercontrols, the "Parent" property seems to be null, it throws
exceptions when I try to use it.

Why do you need that color? Create a 'GraphicsPath' with the appropriate
shape, then convert it to a 'Region' and assign it to the control's
'Region' property.
 
N

Norvin Laudon

veilen danke!

Herfried K. Wagner said:
Why do you need that color? Create a 'GraphicsPath' with the appropriate
shape, then convert it to a 'Region' and assign it to the control's
'Region' property.
 

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