Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. interesting find but why?

interesting find but why?

Scheduled Pinned Locked Moved C#
question
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 508833
    wrote on last edited by
    #1

    i have a background image on my form and i wanted to put a transparent label on it. however, i noticed that a label cannot have it's backcolor changed to 'transparent'. so i created a groupbox and placed a label in it. i then changed to backcolor of the groupbox to 'transparent' and the label's backcolor is now transparent! what the heck? is this a 'feature' of the groupbox or is there some other way of making a label transparent that i don't know about? Rob -- There are 10 kinds of people. Those who understand binary and those who don't.

    U I 2 Replies Last reply
    0
    • U User 508833

      i have a background image on my form and i wanted to put a transparent label on it. however, i noticed that a label cannot have it's backcolor changed to 'transparent'. so i created a groupbox and placed a label in it. i then changed to backcolor of the groupbox to 'transparent' and the label's backcolor is now transparent! what the heck? is this a 'feature' of the groupbox or is there some other way of making a label transparent that i don't know about? Rob -- There are 10 kinds of people. Those who understand binary and those who don't.

      U Offline
      U Offline
      User 508833
      wrote on last edited by
      #2

      *UPDATE* i believe i've come across a bug. try these steps: create a groupbox on a form and set the backcolor to 'transparent'.....works great now change the backcolor back to 'control', change the flatstyle to 'system', then try to set the backcolor to 'transparent'.....error 'Invalid property value.' okay, so it won't let you have a transparent background while the flatstyle is set to system. so change the flatstyle back to 'normal' and change the backcolor to 'transparent'. then change the flatstyle to 'system'.....works!? but it's really buggy, the display in the groupbox fails to update and when the program is run the background of the groupbox is weirded out. i'm NOT using csharp 2003 so i don't know if they've fixed this in the new version or not. did they? why can the backcolor not be transparent if the flatstyle is set to 'system'? Rob Tomson -- There are 10 kinds of people. Those who understand binary and those who don't.

      J 1 Reply Last reply
      0
      • U User 508833

        *UPDATE* i believe i've come across a bug. try these steps: create a groupbox on a form and set the backcolor to 'transparent'.....works great now change the backcolor back to 'control', change the flatstyle to 'system', then try to set the backcolor to 'transparent'.....error 'Invalid property value.' okay, so it won't let you have a transparent background while the flatstyle is set to system. so change the flatstyle back to 'normal' and change the backcolor to 'transparent'. then change the flatstyle to 'system'.....works!? but it's really buggy, the display in the groupbox fails to update and when the program is run the background of the groupbox is weirded out. i'm NOT using csharp 2003 so i don't know if they've fixed this in the new version or not. did they? why can the backcolor not be transparent if the flatstyle is set to 'system'? Rob Tomson -- There are 10 kinds of people. Those who understand binary and those who don't.

        J Offline
        J Offline
        James T Johnson
        wrote on last edited by
        #3

        Rob Tomson wrote: why can the backcolor not be transparent if the flatstyle is set to 'system'? When you set the FlatStyle property to System you are telling the Framework to always let the OS do the drawing for that control. To my knowledge either none or not all of the .NET enabled OSes support the Transparent style which would require the Framework to emulate your choice but that goes against telling the framework to let the OS draw the control. James "My words but a whisper -- your deafness a SHOUT. I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972

        1 Reply Last reply
        0
        • U User 508833

          i have a background image on my form and i wanted to put a transparent label on it. however, i noticed that a label cannot have it's backcolor changed to 'transparent'. so i created a groupbox and placed a label in it. i then changed to backcolor of the groupbox to 'transparent' and the label's backcolor is now transparent! what the heck? is this a 'feature' of the groupbox or is there some other way of making a label transparent that i don't know about? Rob -- There are 10 kinds of people. Those who understand binary and those who don't.

          I Offline
          I Offline
          Ista
          wrote on last edited by
          #4

          even if you do a SetStyle method in the constructor. It works for most controls so since a label is a derivative of the control class you would thinks so. SetStyle must be done in the constructor only by the way I'm not an expert yet, but I play one at work. Yeah and here too.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups