Results 1 to 17 of 17

Thread: transparent label

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    3

    Unhappy transparent label

    Helllllo,
    i thought vb.net would be fun like vb6,, but i'm stuck,, i don't know how to make a label with a transparent background,,ok ok i'v tried setting the bkackcolor property to Transparent.. But still, i cant see thru the label...
    How do i do that?

    thanx

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    You want to make the label transparent and still would be able to see through it? Two different things. When you set the backcolor to transparent, can't you see through it?
    Baaaaaaaaah

  3. #3
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    No, I've tried that and it doesnt work. I think it no longer supports such a thing
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    3
    No Way man,,,, there must be some way to do it.....any body can help????

  5. #5
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    Seems hard to believe that there is not a property for this, but I don't see it.

    If you want to change your labels background color to match the containers background color, you could put code to do this in the containers BackColorChanged event.

    If you just want text that you can see behind, you could draw it with GDI+.

    Either one of those options are easy to do. I hope one of them will work for you.
    That which does not kill us, only makes us stronger.

  6. #6
    Tygur
    Guest
    Straight out of the Help that comes with Visual Studio .NET:
    In Visual Basic 6.0, the BackStyle property of the Label control determined whether the label had a transparent background. Setting the BackStyle property to 0 – Transparent allowed any background image or other controls to show through the label.

    In Visual Basic .NET, the BackStyle property no longer exists, and the transparency behavior is slightly different. To emulate the transparent behavior in Visual Basic .NET, set the BackColor property to System.Drawing.Color.Transparent. This will allow the background image to show through, but it will not be transparent in regard to other controls.

  7. #7
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    so basically it's transparent but it's not transparent

    I dont get it
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  8. #8
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Originally posted by Tygur
    Straight out of the Help that comes with Visual Studio .NET:
    That's exactly I was talking about. I assumed that he was setting to colour to transparent not the backstyle to transparent because, as MSDN says, it doesn't exist anymore.
    Baaaaaaaaah

  9. #9
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Originally posted by MrPolite
    so basically it's transparent but it's not transparent

    I dont get it
    Actually you can change it to opaque or transparent. In previous versions, you could choose your backcolour and then it would be drawn only if the backstyle was opaque. But in new one, you change to opaque or transparent using only the backcolour property. If you click on "Web Colors" or some tab like that in your backcolour property, you'll find the transparent "colour".
    Baaaaaaaaah

  10. #10
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Either I'm acting really dumb or my eyes cant see right
    I have a label over a picturebox. I changed the BGcolor of the lable to Transparent, but still when I run it, the label is covering the pictureBox and it's not trasparent

    what am I doing wrong
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  11. #11
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    I can't try it myself because I haven't installed VB .NET yet but I am sure it supports transparent colour if it doesn't give you any error when you try to set the backcolor to transparent.
    Baaaaaaaaah

  12. #12
    Addicted Member
    Join Date
    Nov 2000
    Location
    San Diego - California
    Posts
    251
    I tried it and it works great.

    Set the Background color to Transparent - (found under the Web colors.)

    I guess the problem lies with the picturebox.

  13. #13
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by BryanJ
    I tried it and it works great.

    Set the Background color to Transparent - (found under the Web colors.)

    I guess the problem lies with the picturebox.
    well yeah I think you're right, it's picturebox's problemmo
    So basically it aint working with pic boxes? doesnt make that much senssssse
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  14. #14
    Tygur
    Guest
    Originally posted by MrPolite
    Either I'm acting really dumb or my eyes cant see right
    I have a label over a picturebox. I changed the BGcolor of the lable to Transparent, but still when I run it, the label is covering the pictureBox and it's not trasparent

    what am I doing wrong
    I don't think you people read my previous quote right. Have another look. Check out the bolded part, in particular:
    In Visual Basic .NET, the BackStyle property no longer exists, and the transparency behavior is slightly different. To emulate the transparent behavior in Visual Basic .NET, set the BackColor property to System.Drawing.Color.Transparent. This will allow the background image to show through, but it will not be transparent in regard to other controls.

  15. #15
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    If you just want simple text, I would draw it on manually with GDI+.
    That which does not kill us, only makes us stronger.

  16. #16
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    See!!! I was right, my eyes cant see right
    tnx Tygur, I really didnt notice that part


    Originally posted by wolfofthenorth
    If you just want simple text, I would draw it on manually with GDI+.
    Umm, is there a way to actually write text ON a control? eeh, I think that's useless anyways
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  17. #17
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    Yea, you can write text on a control. If this is not what you are looking for, sorry. It was just a suggestion, I was only trying to help.
    That which does not kill us, only makes us stronger.

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