BackColor - Not ?

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

    #1

    BackColor - Not ?

    This should be simple.....

    The default BackColor of a button (if you look at its property) is "Control"
    its a gray color, but apparently not a color.

    During a process I set the BackColor of a button to another color by
    using....

    Me.Button.BackC olor = Color.Yellow

    At a later point I want to return it to its original "color"....

    How do I specify "Control" as a "color" ?

    You cannot do...

    Me.Button.BackC olor = Color.Control
    or
    Me.Button.BackC olor = Control

    Thanks !




  • Ray Cassick

    #2
    Re: BackColor - Not ?

    Me.Button.BackC olor = Color.FromKnown Color(KnownColo r.Control)


    "Rob" <robc1@yahoo.co mwrote in message
    news:lc2dnYobyo yOcsHbnZ2dnUVZ_ qemnZ2d@comcast .com...
    This should be simple.....
    >
    The default BackColor of a button (if you look at its property) is
    "Control" its a gray color, but apparently not a color.
    >
    During a process I set the BackColor of a button to another color by
    using....
    >
    Me.Button.BackC olor = Color.Yellow
    >
    At a later point I want to return it to its original "color"....
    >
    How do I specify "Control" as a "color" ?
    >
    You cannot do...
    >
    Me.Button.BackC olor = Color.Control
    or
    Me.Button.BackC olor = Control
    >
    Thanks !
    >
    >
    >
    >

    Comment

    • Michael C

      #3
      Re: BackColor - Not ?

      "Ray Cassick" <rcassick@enter procity.comwrot e in message
      news:OXPo2smoHH A.4124@TK2MSFTN GP02.phx.gbl...
      Me.Button.BackC olor = Color.FromKnown Color(KnownColo r.Control)
      Easier to use this.BackColor = SystemColors.Co ntrol

      Michael


      Comment

      • Rob

        #4
        Re: BackColor - Not ?

        Thanks Ray !

        "Ray Cassick" <rcassick@enter procity.comwrot e in message
        news:OXPo2smoHH A.4124@TK2MSFTN GP02.phx.gbl...
        Me.Button.BackC olor = Color.FromKnown Color(KnownColo r.Control)
        >
        >
        "Rob" <robc1@yahoo.co mwrote in message
        news:lc2dnYobyo yOcsHbnZ2dnUVZ_ qemnZ2d@comcast .com...
        >This should be simple.....
        >>
        >The default BackColor of a button (if you look at its property) is
        >"Control" its a gray color, but apparently not a color.
        >>
        >During a process I set the BackColor of a button to another color by
        >using....
        >>
        >Me.Button.Back Color = Color.Yellow
        >>
        >At a later point I want to return it to its original "color"....
        >>
        >How do I specify "Control" as a "color" ?
        >>
        >You cannot do...
        >>
        >Me.Button.Back Color = Color.Control
        > or
        >Me.Button.Back Color = Control
        >>
        >Thanks !
        >>
        >>
        >>
        >>
        >
        >

        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: BackColor - Not ?

          "Michael C" <nospam@nospam. comschrieb:
          >Me.Button.Back Color = Color.FromKnown Color(KnownColo r.Control)
          >
          Easier to use this.BackColor = SystemColors.Co ntrol
          I'd recommend that too. In addition it may be useful to store the old value
          in a private variable (or similar) and assign its value to the property
          later.

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

          Comment

          Working...