Change enable=false forecolor

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

    Change enable=false forecolor

    greeting folks

    I would like to change the foreground color for a disabled textbox from the
    dimmed gray to something else that is easlier readable. I can change the
    background using the following:
    textbox1.BackCo lor = System.Drawing. SystemColors.Co ntrol.White

    however i cant for the life of me figure out the foreground . any help would
    be appreciated



    steve


  • Q

    #2
    Re: Change enable=false forecolor

    Hey Stephen,

    I had the same problem.
    Since then, I use the ReadOnly-properth in stead of the Enabled.
    If ReadOnly is set to true, the forecolor can be changed!
    Maybe this helps you???

    Regards,

    Q

    "Stephen" <Stephefn@xjohn stontrading.com > wrote in message
    news:e4CwUUB%23 EHA.2180@TK2MSF TNGP10.phx.gbl. ..[color=blue]
    > greeting folks
    >
    > I would like to change the foreground color for a disabled textbox from[/color]
    the[color=blue]
    > dimmed gray to something else that is easlier readable. I can change the
    > background using the following:
    > textbox1.BackCo lor = System.Drawing. SystemColors.Co ntrol.White
    >
    > however i cant for the life of me figure out the foreground . any help[/color]
    would[color=blue]
    > be appreciated
    >
    >
    >
    > steve
    >
    >[/color]


    Comment

    • Stephen

      #3
      Re: Change enable=false forecolor

      excellent idea, i didnt think about that. i need to be able to change the
      foreground to different colors depending on criteria in the app.... do u
      have a example ?

      again thanks
      stephen
      "Q" <Q@nomail.be> wrote in message
      news:ewwvaaB%23 EHA.2032@tk2msf tngp13.phx.gbl. ..[color=blue]
      > Hey Stephen,
      >
      > I had the same problem.
      > Since then, I use the ReadOnly-properth in stead of the Enabled.
      > If ReadOnly is set to true, the forecolor can be changed!
      > Maybe this helps you???
      >
      > Regards,
      >
      > Q
      >
      > "Stephen" <Stephefn@xjohn stontrading.com > wrote in message
      > news:e4CwUUB%23 EHA.2180@TK2MSF TNGP10.phx.gbl. ..[color=green]
      > > greeting folks
      > >
      > > I would like to change the foreground color for a disabled textbox from[/color]
      > the[color=green]
      > > dimmed gray to something else that is easlier readable. I can change the
      > > background using the following:
      > > textbox1.BackCo lor = System.Drawing. SystemColors.Co ntrol.White
      > >
      > > however i cant for the life of me figure out the foreground . any help[/color]
      > would[color=green]
      > > be appreciated
      > >
      > >
      > >
      > > steve
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Change enable=false forecolor

        "Q" <Q@nomail.be> schrieb:[color=blue]
        > Since then, I use the ReadOnly-properth in stead of the Enabled.
        > If ReadOnly is set to true, the forecolor can be changed![/color]

        This doesn't work on my machine running .NET 1.1 SP1, Windows XP
        Professional SP2. Using a richtextbox instead of the textbox will allow you
        to set the forecolor even if the textbox is disabled or read-only.

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

        Comment

        • Q

          #5
          Re: Change enable=false forecolor

          Hey again Stephen,

          here's the example you asked for!

          Regards,

          Q

          Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
          System.EventArg s) Handles Button1.Click
          MyTextbox.BackC olor = System.Drawing. Color.Green
          MyTextbox.ForeC olor = System.Drawing. Color.White
          End Sub



          "Stephen" <Stephefn@xjohn stontrading.com > wrote in message
          news:eq9olhB%23 EHA.2680@TK2MSF TNGP09.phx.gbl. ..[color=blue]
          > excellent idea, i didnt think about that. i need to be able to change the
          > foreground to different colors depending on criteria in the app.... do u
          > have a example ?
          >
          > again thanks
          > stephen
          > "Q" <Q@nomail.be> wrote in message
          > news:ewwvaaB%23 EHA.2032@tk2msf tngp13.phx.gbl. ..[color=green]
          > > Hey Stephen,
          > >
          > > I had the same problem.
          > > Since then, I use the ReadOnly-properth in stead of the Enabled.
          > > If ReadOnly is set to true, the forecolor can be changed!
          > > Maybe this helps you???
          > >
          > > Regards,
          > >
          > > Q
          > >
          > > "Stephen" <Stephefn@xjohn stontrading.com > wrote in message
          > > news:e4CwUUB%23 EHA.2180@TK2MSF TNGP10.phx.gbl. ..[color=darkred]
          > > > greeting folks
          > > >
          > > > I would like to change the foreground color for a disabled textbox[/color][/color][/color]
          from[color=blue][color=green]
          > > the[color=darkred]
          > > > dimmed gray to something else that is easlier readable. I can change[/color][/color][/color]
          the[color=blue][color=green][color=darkred]
          > > > background using the following:
          > > > textbox1.BackCo lor = System.Drawing. SystemColors.Co ntrol.White
          > > >
          > > > however i cant for the life of me figure out the foreground . any help[/color]
          > > would[color=darkred]
          > > > be appreciated
          > > >
          > > >
          > > >
          > > > steve
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...