• 0

[VB .Net] Label Transparency over Pic


Question

I am working on my on going project and have come across a problem. I wan tto have a picture box filling the back ground with 2 labels over it. However, when I set the label background color to Web/Transparent, the background still comes out grey when I run the program and this is a problem. How do I make it so that the label is truely transparent and you see the contents of the picture box behind it?

Link to comment
https://www.neowin.net/forum/topic/66887-vb-net-label-transparency-over-pic/
Share on other sites

Recommended Posts

  • 0

Got it to work.

Transparent Label in VB with a custom panel

Ok, I think the only drawback is that I wrote this with VS.NET 2003. The project file may not work, but all the source should work in a VS.NET 2002 version. Also, you'll need to change the location of the image to a valid path on your machine. Works well, even with PNGs with alpha transparency. :D

I'm going to bed, so I'll field any questions later today.

  • 0

Thanks. The most mind bending part was figuring out how to get the panel to draw without flicker. I tried for a while to use the old GDI method of double buffering, that is writing the resized bitmap to a memory bitmap then blitting on to the screen, but it just wasn't working well. Then it occurred to me that I could make a user control that inherited from Panel and use the SetStyle method to set it to double buffer on its own. I love .NET! What used to take more than a few lines of code has been reduced dramatically.

  • 0
  weenur said:
Thanks. The most mind bending part was figuring out how to get the panel to draw without flicker. I tried for a while to use the old GDI method of double buffering, that is writing the resized bitmap to a memory bitmap then blitting on to the screen, but it just wasn't working well. Then it occurred to me that I could make a user control that inherited from Panel and use the SetStyle method to set it to double buffer on its own. I love .NET! What used to take more than a few lines of code has been reduced dramatically.

hard for a 16 to think of that lol. only have about 1.5 month experioence on this

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.