Enable/Disable Labels

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom

    #1

    Enable/Disable Labels

    Hi:

    When you disable a text box you get the "ghost effect" on the
    associated label control. How can you mimic that same effect on a
    label not associated with a text box?

    Basically, the setup I have is:

    lblControlName txtControl lblUnit

    Where:
    lblControlName is the title of the control (e.g., "Density")
    txtControl is the value (e.g., 8.34)
    lblUnit is the unit for the control (e.g., "lbs/gal")

    For certain records I need to disable txtControl because I don't what
    the user entering data. When I set enabled = false for txtControl,
    lblControlName also goes to ghost. However, lblUnit doesn't and it
    looks funny. How do I get it to mimic the ghost effect?

    Thanks
    Tom

  • MLH

    #2
    Re: Enable/Disable Labels

    Faced with the same dilemma in the past, I have resorted to
    setting the label's Foreground and Background properties to
    the colors in which the 'grayed out' text boxes are displayed
    in. I seem to remember launching a discusion on that topic
    on this NG a good while back and that was the best that
    turned up.

    xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxx


    On 20 Dec 2006 08:59:25 -0800, "Tom" <rtmnews@swbell .netwrote:
    >Hi:
    >
    >When you disable a text box you get the "ghost effect" on the
    >associated label control. How can you mimic that same effect on a
    >label not associated with a text box?
    >
    >Basically, the setup I have is:
    >
    >lblControlNa me txtControl lblUnit
    >
    >Where:
    >lblControlNa me is the title of the control (e.g., "Density")
    >txtControl is the value (e.g., 8.34)
    >lblUnit is the unit for the control (e.g., "lbs/gal")
    >
    >For certain records I need to disable txtControl because I don't what
    >the user entering data. When I set enabled = false for txtControl,
    >lblControlNa me also goes to ghost. However, lblUnit doesn't and it
    >looks funny. How do I get it to mimic the ghost effect?
    >
    >Thanks
    >Tom

    Comment

    • John Welch

      #3
      Re: Enable/Disable Labels

      Tom, this isn't a very elegant solution, but it works: you can make one long
      label that contains both the control name and the units, with a big gap in
      the middle that you cover up with the textbox. If this long label is
      associated with the textbox, the whole thing will grey out when you disable
      the textbox.
      -John

      "Tom" <rtmnews@swbell .netwrote in message
      news:1166633965 .146152.211830@ 80g2000cwy.goog legroups.com...
      Hi:
      >
      When you disable a text box you get the "ghost effect" on the
      associated label control. How can you mimic that same effect on a
      label not associated with a text box?
      >
      Basically, the setup I have is:
      >
      lblControlName txtControl lblUnit
      >
      Where:
      lblControlName is the title of the control (e.g., "Density")
      txtControl is the value (e.g., 8.34)
      lblUnit is the unit for the control (e.g., "lbs/gal")
      >
      For certain records I need to disable txtControl because I don't what
      the user entering data. When I set enabled = false for txtControl,
      lblControlName also goes to ghost. However, lblUnit doesn't and it
      looks funny. How do I get it to mimic the ghost effect?
      >
      Thanks
      Tom
      >

      Comment

      • deluxeinformation@gmail.com

        #4
        Re: Enable/Disable Labels

        Another approach is to associate the label with an unbound textbox.
        Set the textbox width to 0, special effect to flat, border and
        background to transparent, and tab stop to 'no'. The textbox will be
        effectively hidden at that point and its associated label can be
        'disabled' by disabling the textbox.

        Bruce

        Comment

        • Tom

          #5
          Re: Enable/Disable Labels

          Thanks to all 3 of you for your thoughts. It seems like there are a
          few work arounds, but no elegant solutions. <sigh>.

          Bruce - I think I like your solution the best, it seems to be the one
          least likely to have unexpected problems crop up at a later date.

          Tom


          deluxeinformati on@gmail.com wrote:
          Another approach is to associate the label with an unbound textbox.
          Set the textbox width to 0, special effect to flat, border and
          background to transparent, and tab stop to 'no'. The textbox will be
          effectively hidden at that point and its associated label can be
          'disabled' by disabling the textbox.
          >
          Bruce

          Comment

          Working...