Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# Control - Transparent Label
Message
From
09/10/2007 17:46:56
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
01259615
Message ID:
01259891
Views:
17
Kevin,

That article seems pretty straightforward to me, I'm not sure what you're not understanding.

How about we try this ... post the relevant code here and maybe we'll be able to spot the problem.

~~Bonnie



>I'm still not getting it. Why can't I make a label transparent????
>
>I found this article, but I need help understanding what it's telling me to do.
>http://msdn2.microsoft.com/en-us/library/wk5b13s4.aspx
>
>
>
>
>>You'd need to set the control style to support transparency
>>
>>
>> private bool _HacerTransparente;
>>        public bool HacerTransparente
>>        {
>>            get { return _HacerTransparente; }
>>            set
>>            {
>>                _HacerTransparente = value;
>>
>>                this.SetStyle(ControlStyles.SupportsTransparentBackColor, _HacerTransparente);
>>                if (_HacerTransparente)
>>                {
>>                    BackColor = Color.Transparent ;
>>                }
>>                else
>>                {
>>                    BackColor = BackGroundColor;
>>                }
>>            }
>>        }
>>
>>
>>HTH,
>>
>>Enmanuel
>>
>>>I have tried both, and it has no effect. The label is not transparent.
>>>
>>>I have a panel control with a picturebox in it of a gradient. The label is then on top of the gradient. The label appears as black text inside a white rectangle.
>>>
>>>
>>>
>>>
>>>>>How do I set the background of a label to transparent?
>>>>
>>>>
>>>>this.MyLabel.BackColor = System.Drawing.Color.Transparent;
>>>>
>>>>
>>>>Or, from the PropertySheet's color picker, choose the Web tab to find the Transparent color.
>>>>
>>>>~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform