How to Get Transparent Label Background??

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
12 posts Page 1 of 2
Contributors
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Hi All
In my new app that i am doing, I have a Panel with a Picturebox ( Docked within it ) with a Label on top of it

Now I have had this issue before, and too be honest i cant remember if i found a solution to it or not :?

The Label's BackColor will take on the color of the forms Background, and I want to make it Transparent, so that when you Drag the Text around the Area it does not show the forms background color, if that makes sense.

Like in this Pic Below

Image

The Label has a Transparent background in Properties
I had coded it so that as you typed, it told the Label to be Transparent ( but that does not address the issue )

I dont really want to change the way the app works as i have got it all working great wahooo; But all but this issue with the Label Background.

Has anyone come across this before and if you did, How did you rectify it ?

Chris
Image
User avatar
upperdrag
Excellent Poster
Excellent Poster
Posts: 321
Joined: Fri Mar 12, 2010 12:05 pm

right right, if i could remember i have this problem before but i tried this method,,
make the panel's background image to your desired image and add another picture box over the initial image (the panel's backgroud image) then make the label's background settings as transparent.
did it work o.o?
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

right right, if i could remember i have this problem before but i tried this method,,
make the panel's background image to your desired image and add another picture box over the initial image (the panel's backgroud image) then make the label's background settings as transparent.
did it work o.o?
Hi Upperdrag

I tried that above and its still showing the forms Background color, I dont know what the answer is

Thanks for your Help tho cooll;

Chris
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Try using the Paint event to draw a string directly to that area.
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Hungry hound, Set the image of the button as the background image of your panel and set the label's property to transparent and it should fix it.
Image
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Try using the Paint event to draw a string directly to that area.
Hi Mandai
ok i will give that a go cooll;

Set the image of the button as the background image of your panel and set the label's property to transparent and it should fix it
Hi Lewis

Yes that does work, But if i change the Button then it shows the label backcolor :?

Thanks for the Help tho cooll;

Chris
Image
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Well when you change the button are you using the form background as the button when you change it, you might also need to make it transparent after changing the button
Image
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Hello hungryhounduk,

I thought this was working?. In the button beast demo I downloaded it seems to work fine when adding text and moving it around, stays transparent :?

Or are you not on about button beast?
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

I thought this was working?. In the button beast demo I downloaded it seems to work fine when adding text and moving it around, stays transparent

Or are you not on about button beast?
Hi Codenstuff
Yes its Button Beast, but a new version that i am working on, and it uses a Picturebox to add the Images from the Computer, and the buttons are imported into a Panel.

Its probably the Picturebox i have added for the Images that is giving the problem, as i remember way back i did have the same problem, and changed it to a Panel.

But i have coded it all now and i dont really want to go through the whole lot of code changing the Picturebox to a Panel..

But then again I might just have to do that ;)

Chris
Image
User avatar
Harlem9191
Top Poster
Top Poster
Posts: 87
Joined: Mon Jan 18, 2010 8:45 pm

Transparency isn't really supported in vb.net :/
There are loads of articles somewhere on google explaining why.
12 posts Page 1 of 2
Return to “Coding Help & Support”