Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BackColor does not work
Message
From
24/08/2010 12:25:40
 
 
To
23/08/2010 09:58:56
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01477913
Message ID:
01478166
Views:
31
Michel,

This did not work as you expected it to in VS2008 either, so it's not a VS2010 issue. Basically I think what happens is that behind the scenes the BackColor of the label takes on the BackColor of its Parent ... it's not really Transparent. If the Parent.BackColor changes, the label.BackColor get changed to match it "behind the scenes". So, typically the label would retain the Form's BackColor. Once you changed the Parent of the Label to the PictureBox, then it correctly uses the image as its BackColor.

Unfortunately, the PictureBox is not a container control, so there's no drag-and-drop way to make it the Parent of the Label.You're stuck having to code it. However ... if you had used a Panel instead of a PictureBox, it would have worked with drag-and-dropping the label into the Panel. A Panel can have an image background.

~~Bonnie


>This support is no longer supported in VS 2010. Basically, we have to set the Parent property of the label to the PictureBox. And, worst, the Parent property is not even in the designer. And, worst, if you have it into a TabControl, everything get lost as far as the location.
>
>So, I had to do this:
>
>
>        ' Adjust support for VS 2010
>        Label1.Parent = LxPictureBox3
>        Label1.BackColor = Color.Transparent
>        Label1.BringToFront()
>        Label1.Location = New Point(180, 192)
>
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