How to change textbox font color when disable ?

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

    How to change textbox font color when disable ?

    When textbox properties enable = False the font in the textbox become gray
    color. How do I change the gray color to black color ?


    Regards,
    Tee


  • Phill W.

    #2
    Re: How to change textbox font color when disable ?

    engteng wrote:
    When textbox properties enable = False the font in the textbox become gray
    color. How do I change the gray color to black color ?
    If your users have had Windows PC's for more than about three days, then
    you should not do this, unless you have a really, /really/ Good Reason
    to do so (e.g. specialised applications for, say, poorly-lit working
    conditions).

    Grey text on disabled controls is /standard/ Windows behaviour that will
    be exhibited when your application runs on practically every Windows PC
    on the planet.

    OK, there /are/ a few cases where this is justifiable; just so long as
    (a) you realise that there are /very/ few such cases, and
    (b) your users know in advance that your application is going to behave
    this way.

    Applications that do "odd" things may be reported as "buggy" or
    un-installed completely (just try changing the screen resolution on me!)
    :-)

    Regards,
    Phill W.

    Comment

    • Jan Hyde (VB MVP)

      #3
      Re: How to change textbox font color when disable ?

      "engteng" <passrcv@gmail. com>'s wild thoughts were released
      on Wed, 8 Oct 2008 18:23:47 +0800 bearing the following
      fruit:
      >When textbox properties enable = False the font in the textbox become gray
      >color. How do I change the gray color to black color ?
      >
      Normally when someone asks this it's because someone finds
      the grey text hard to see. In which case they sould change
      this colour on their PC to something other than grey.


      --
      Jan Hyde (VB MVP)


      Comment

      • rowe_newsgroups

        #4
        Re: How to change textbox font color when disable ?

        On Oct 8, 6:23 am, "engteng" <pass...@gmail. comwrote:
        When textbox properties enable = False the font in the textbox become gray
        color. How do I change the gray color to black color ?
        >
        Regards,
        Tee
        Switch to WPF

        :-)

        Thanks,

        Seth Rowe [MVP]

        Comment

        • =?Utf-8?B?anAybXNmdA==?=

          #5
          RE: How to change textbox font color when disable ?

          engteng:

          I see what you are trying to do. Instead of setting the TextBox's Enabled
          Property to False, try setting the ReadOnly Property to True.

          I bet you a dollar this is what you are trying to accomplish.

          "engteng" wrote:
          When textbox properties enable = False the font in the textbox become gray
          color. How do I change the gray color to black color ?
          >
          >
          Regards,
          Tee
          >
          >
          >

          Comment

          • engteng

            #6
            Re: How to change textbox font color when disable ?

            This will do but what is the best way to avoid this textbox to have gotfocus
            even it is readonly ?


            Regards,
            Tee

            "jp2msft" <jp2msft@discus sions.microsoft .comwrote in message
            news:3BB9903A-B7BD-44DB-AFDC-64D799A4356B@mi crosoft.com...
            engteng:
            >
            I see what you are trying to do. Instead of setting the TextBox's Enabled
            Property to False, try setting the ReadOnly Property to True.
            >
            I bet you a dollar this is what you are trying to accomplish.
            >
            "engteng" wrote:
            >
            >When textbox properties enable = False the font in the textbox become
            >gray
            >color. How do I change the gray color to black color ?
            >>
            >>
            >Regards,
            >Tee
            >>
            >>
            >>

            Comment

            • engteng

              #7
              Re: How to change textbox font color when disable ?

              You are right (Gray hard to see) so I am using Windows XP sp3 any way to
              change the gray color ?

              Regards,
              Tee


              "Jan Hyde (VB MVP)" <StellaDrinker@ REMOVE.ME.uboot .comwrote in message
              news:83ape4p8d2 0ntvb82e06u66ap kcp1qti1j@4ax.c om...
              "engteng" <passrcv@gmail. com>'s wild thoughts were released
              on Wed, 8 Oct 2008 18:23:47 +0800 bearing the following
              fruit:
              >
              >>When textbox properties enable = False the font in the textbox become gray
              >>color. How do I change the gray color to black color ?
              >>
              >
              Normally when someone asks this it's because someone finds
              the grey text hard to see. In which case they sould change
              this colour on their PC to something other than grey.
              >
              >
              --
              Jan Hyde (VB MVP)
              >
              https://mvp.support.microsoft.com/profile/Jan.Hyde

              Comment

              • Cor Ligthert[MVP]

                #8
                Re: How to change textbox font color when disable ?

                textbox.Next maybe

                Cor

                "engteng" <passrcv@gmail. comschreef in bericht
                news:ejFmDreKJH A.4708@TK2MSFTN GP02.phx.gbl...
                This will do but what is the best way to avoid this textbox to have
                gotfocus even it is readonly ?
                >
                >
                Regards,
                Tee
                >
                "jp2msft" <jp2msft@discus sions.microsoft .comwrote in message
                news:3BB9903A-B7BD-44DB-AFDC-64D799A4356B@mi crosoft.com...
                >engteng:
                >>
                >I see what you are trying to do. Instead of setting the TextBox's Enabled
                >Property to False, try setting the ReadOnly Property to True.
                >>
                >I bet you a dollar this is what you are trying to accomplish.
                >>
                >"engteng" wrote:
                >>
                >>When textbox properties enable = False the font in the textbox become
                >>gray
                >>color. How do I change the gray color to black color ?
                >>>
                >>>
                >>Regards,
                >>Tee
                >>>
                >>>
                >>>
                >
                >

                Comment

                • kimiraikkonen

                  #9
                  Re: How to change textbox font color when disable ?

                  On Oct 9, 11:38 am, "engteng" <pass...@gmail. comwrote:
                  This will do but what is the best way to avoid this textbox to have gotfocus
                  even it is readonly ?
                  >
                  Regards,
                  Tee
                  >
                  "jp2msft" <jp2m...@discus sions.microsoft .comwrote in message
                  >
                  news:3BB9903A-B7BD-44DB-AFDC-64D799A4356B@mi crosoft.com...
                  >
                  >
                  >
                  engteng:
                  >
                  I see what you are trying to do. Instead of setting the TextBox's Enabled
                  Property to False, try setting the ReadOnly Property to True.
                  >
                  I bet you a dollar this is what you are trying to accomplish.
                  >
                  "engteng" wrote:
                  >
                  When textbox properties enable = False the font in the textbox become
                  gray
                  color. How do I change the gray color to black color ?
                  >
                  Regards,
                  Tee- Hide quoted text -
                  >
                  - Show quoted text -
                  It maybe considered as a primitive way, but you can try to handle your
                  ReadOnly Textbox's GotFocus event and when it gets focus then focus
                  another UI control to lose focus of textbox as follows:

                  '---------------------------------------------------
                  Private Sub TextBox1_GotFoc us(ByVal sender As Object, _
                  ByVal e As System.EventArg s) Handles TextBox1.GotFoc us

                  ' when it gets focus select another control
                  Textbox1.Select NextControl

                  ' ...OR focus another control manually
                  ' eg: a button
                  Button1.Focus

                  End Sub
                  '-----------------------------------------------------

                  Hope this helps,

                  Onur Güzel

                  Comment

                  • kimiraikkonen

                    #10
                    Re: How to change textbox font color when disable ?

                    On Oct 9, 1:40 pm, kimiraikkonen <kimiraikkone.. .@gmail.comwrot e:
                    On Oct 9, 11:38 am, "engteng" <pass...@gmail. comwrote:
                    >
                    >
                    >
                    >
                    >
                    This will do but what is the best way to avoid this textbox to have gotfocus
                    even it is readonly ?
                    >
                    Regards,
                    Tee
                    >
                    "jp2msft" <jp2m...@discus sions.microsoft .comwrote in message
                    >
                    news:3BB9903A-B7BD-44DB-AFDC-64D799A4356B@mi crosoft.com...
                    >
                    engteng:
                    >
                    I see what you are trying to do. Instead of setting the TextBox's Enabled
                    Property to False, try setting the ReadOnly Property to True.
                    >
                    I bet you a dollar this is what you are trying to accomplish.
                    >
                    "engteng" wrote:
                    >
                    >When textbox properties enable = False the font in the textbox become
                    >gray
                    >color. How do I change the gray color to black color ?
                    >
                    >Regards,
                    >Tee- Hide quoted text -
                    >
                    - Show quoted text -
                    >
                    It maybe considered as a primitive way, but you can try to handle your
                    ReadOnly Textbox's GotFocus event and when it gets focus then focus
                    another UI control to lose focus of textbox as follows:
                    >
                    '---------------------------------------------------
                    Private Sub TextBox1_GotFoc us(ByVal sender As Object, _
                    ByVal e As System.EventArg s) Handles TextBox1.GotFoc us
                    >
                    ' when it gets focus select another control
                    Textbox1.Select NextControl
                    >
                    ' ...OR focus another control manually
                    ' eg: a button
                    Button1.Focus
                    >
                    End Sub
                    '-----------------------------------------------------
                    >
                    Hope this helps,
                    >
                    Onur Güzel- Hide quoted text -
                    >
                    - Show quoted text -
                    Regarding to SelectNextContr ol in my previous post, as i forgot, don't
                    forget to pass required arguments mentioned on:


                    ...or selecting / focusing a specific control manually like button
                    would be shorter way to make your textbox lose focus when it gets
                    focus :-)

                    Thanks,

                    Onur Güzel

                    Comment

                    • Jan Hyde (VB MVP)

                      #11
                      Re: How to change textbox font color when disable ?

                      "engteng" <passrcv@gmail. com>'s wild thoughts were released
                      on Thu, 9 Oct 2008 16:48:30 +0800 bearing the following
                      fruit:
                      >You are right (Gray hard to see) so I am using Windows XP sp3 any way to
                      >change the gray color ?
                      Sure, just change it under appearance settings.

                      Can't recall the steps to get you there in XP though.

                      J
                      >Regards,
                      >Tee
                      >
                      >
                      >"Jan Hyde (VB MVP)" <StellaDrinker@ REMOVE.ME.uboot .comwrote in message
                      >news:83ape4p8d 20ntvb82e06u66a pkcp1qti1j@4ax. com...
                      >"engteng" <passrcv@gmail. com>'s wild thoughts were released
                      >on Wed, 8 Oct 2008 18:23:47 +0800 bearing the following
                      >fruit:
                      >>
                      >>>When textbox properties enable = False the font in the textbox become gray
                      >>>color. How do I change the gray color to black color ?
                      >>>
                      >>
                      >Normally when someone asks this it's because someone finds
                      >the grey text hard to see. In which case they sould change
                      >this colour on their PC to something other than grey.
                      >>
                      >>
                      >--
                      >Jan Hyde (VB MVP)
                      >>
                      >https://mvp.support.microsoft.com/profile/Jan.Hyde
                      >
                      --
                      Jan Hyde (VB MVP)


                      Comment

                      Working...