transparent usercontrol

  • Thread starter Thread starter Norvin Laudon
  • Start date Start date
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
 
* "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.
 
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.
 
Back
Top