Android Question font change color

Discussion in 'Android Questions' started by Randy B. Calahi, Jun 27, 2019.

  1. Randy B. Calahi

    Randy B. Calahi Member Licensed User

    how to change font color in EditText?
     
  2. emexes

    emexes Well-Known Member Licensed User

    I would have thought, with the .TextColor property.

    But the fact that you're asking, makes me think perhaps it is not that simple, so I'll give it a burl just to be sure.
     
  3. Xicu

    Xicu Member Licensed User

    Using de property textcolor
    Example:
    EditText1.TextColor=Colors.ARGB(163, 255, 255, 0)
     
    Randy B. Calahi likes this.
  4. Randy B. Calahi

    Randy B. Calahi Member Licensed User

  5. emexes

    emexes Well-Known Member Licensed User

    Great minds think alike :)

    I used:
    Code:
    Sub Button1_Click
      
        
    If Rnd(13) = 1 Then
            EditText1.TextColor = 
    Colors.Black
        
    Else
            EditText1.TextColor = 
    Colors.RGB(Rnd(0255), Rnd(0255), Rnd(0255))
        
    End If

    End Sub
    to demonstrate use of the Colors.* built-in color constants, and building colors from RGB components, to get eg this:

    upload_2019-6-27_18-24-32.png
     
    Xicu likes this.
  6. emexes

    emexes Well-Known Member Licensed User

    Note that you can set/change that property from within Designer too, as well as from within your program.

    And the .Color property changes the background color.
     
  7. emexes

    emexes Well-Known Member Licensed User

    This must be some incredible multi-hued extravaganza you're coding up, what with all these colorful questions!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice