Results 1 to 3 of 3

Thread: Label Transparent VB.NET

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2009
    Posts
    10

    Label Transparent VB.NET

    Hi,

    I'm trying to make a label control transparent over a Panel control.

    However by setting the background colour of the label to Transparent, it actually sees right through to the form itself, not the panel as intended.

    As an example we use a panel with a background as white, we make the label transparent, however it gets the form’s colour as blue.

    However, we are using a custom panel control and need the label to be transparent over the panel and not see the forms background.

    Is this possible?

    Thank you.

  2. #2
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    Re: Label Transparent VB.NET

    Is your button IN the panel or OVER the panel? A label in the panel, when the background is set to transparent, will actually have a background color of the hosting container (or whatever the 'background' is).

    Basically, transparency isn't what you think it is. When you set the background color to transparent, whatever is drawn on the background of the parent container is drawn into the background of the label.

    I don't think there is an easy way of doing what you want, and most methods are a hack. Simply, if you want unaliased text, then you can do it easier (regions), but aliased drawing/text requires some bitmaps and painting. Perhaps WPF (windows presentation foundation) has some methods that can do this?
    Last edited by SJWhiteley; Jul 9th, 2009 at 09:18 AM.
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

  3. #3
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Label Transparent VB.NET

    Just to add to what SJWhitely says - this is totally different to the behaviour in VB6 which I guess is what you are alluding to in your title.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width