Transparent label in VB.NET

Discussion in 'OT Technology' started by Runescaper, Mar 1, 2006.

  1. Runescaper

    Runescaper Guest

    I'm trying to make a transparent label for a progress bar in VB.NET. The problem is, if I set the label to transparent it still has a grey background. Is there any way to do this or would I have to paint the text to the screen instead of using a label?
     
  2. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    My advice, though it's not a direct answer: Better to use VB6 if you have a choice. It's much better at being (ahem) BASIC than VB.NET will ever be. God ony knows why they took a perfectly good scripting language and bastardized it to be a less-effective replacement for C++.
     
  3. wparsons

    wparsons New Member

    Joined:
    Feb 21, 2006
    Messages:
    62
    Likes Received:
    0
    Change the background colour on the label?
     
  4. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    That's not a good fix either. What happens if the user of the program has a different color scheme on their computer? The best thing I can think of at the moment is to do a google search for Windows Transparent Color Code or something like that (remember color codes are in hexadecimal) and put in a line in Form_Load() that assigns that color code to the label in question.
     
  5. Runescaper

    Runescaper Guest

    The problem with that is, as the progress bar moves past the label the background color would have to change to match the color of the progress bar. I could change it to green as this happens, somewhat matching the bar, but it would still look awkward.

    I've managed to get the effect I want by drawing the string to the progress bar instead of using a label.....still curious if there's a way to do it with a label though. :dunno:


    I'll look into your suggestion, deusexaethera.
     
    Last edited by a moderator: Mar 2, 2006
  6. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    worst advice ever. Do NOT down grade to vb6. It was a shit language, and hardly anybody will use it soon. VB.NET/C# are real OO programming languages.
     
  7. Yep

    Yep Knick knack paddy whack, give the old dog a bone

    Joined:
    Jan 22, 2001
    Messages:
    4,603
    Likes Received:
    0
    Location:
    South Jersey
    I've never heard of a way to do this with a standard label control in any version of VB but would like to know if it is possible.
     
  8. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    If you notice, I specified that VB6 was a good language for doing things quickly and easily. VB.NET, on the other hand, has no unique place in the spectrum of programming languages because C++, C#, and Java all do what VB.NET does, and they do it better. VB.NET is harder to use than VB6, and it still can't do anything the C-based languages can't do. The only reason it exists is because BASIC is the only language Bill Gates knows how to use, and he wanted to give it more legitimacy with code snobs like yourself. VB6 will fade out only because it's not supported anymore, NOT because it's a shit language.
     

Share This Page