Results 1 to 2 of 2

Thread: [RESOLVED] transparent label

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2010
    Posts
    78

    Resolved [RESOLVED] transparent label

    I have a picturebox with a picture in it.
    I have put a label over them and set its background color to transparent, and the font is red.

    when I run the program I see that the label is not transparent, but white.

    I would have expected to see only the font on the label, and the picture behind.


    What am I doing wrong?

    Or how can I do it right?

    Thanks.

  2. #2
    Frenzied Member IanRyder's Avatar
    Join Date
    Jan 2013
    Location
    Healing, UK
    Posts
    1,232

    Re: transparent label

    Hi,

    There is a bit of trick to this since setting the Color of the Label to Transparent does work but the Label's current Parent container is the Form so the Label is currently getting its own BackColor / Transparency from there and not the Picture which the label is on top of.

    So, to get round this, add a Panel and set its Background Image to your Picture. Now, position the Label over the Picture where you want it (The Label's Parent is now the Panel which has the Picture on it and not the Blank Form). Finally run the code with the Label's Background Color set to Transparent. That's it.

    Hope that helps.

    Cheers,

    Ian

    NB, This is for VS2010 so I am making the assumption that this should be the same for VS2008.

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