Wish B4XFloatTextField - Empty/Non Empty Hint Text

rasaliad

Member
Licensed User
Hello, I would like to be able to put a more explanatory hint when the edit is empty and when the person begins to write and the hint moves, then the description is more general, for example:

Empty Hint Text: Write your full name here or John Smith
Non Empty Hint Text: Full name (when begin to write and the hint move).

Another example:

Empty Hint Text: Write your monthly salary in US$
Non Empty Hint Text: Monthly salary US$ (when begin to write and the hint move).

I hope you consider these properties useful as I do and that it is easy and possible to implement for a future update.

Thanks

Rafael Liriano
 
Last edited:

oparra

Well-Known Member
Licensed User
Do you want to do this in B4XFloatTextField?
 

Attachments

  • 1.gif
    1.gif
    38.1 KB · Views: 45

oparra

Well-Known Member
Licensed User
B4X:
Private Sub B4XFloatTextField1_TextChanged (Old As String, New As String)
    B4XFloatTextField1_FocusChanged (True)
End Sub

B4X:
Private Sub B4XFloatTextField1_FocusChanged (HasFocus As Boolean)
    If HasFocus Then
        If B4XFloatTextField1.Text = "" Then
            B4XFloatTextField1.HintText = "Full name"
        Else
            B4XFloatTextField1.HintText = "Write your full name here Or John Smith"
        End If
    Else
        If B4XFloatTextField1.Text = "" Then
            B4XFloatTextField1.HintText = "Write your full name here Or John Smith"
        End If
    End If
    B4XFloatTextField1.Update
End Sub
 

rasaliad

Member
Licensed User
B4X:
Private Sub B4XFloatTextField1_TextChanged (Old As String, New As String)
    B4XFloatTextField1_FocusChanged (True)
End Sub

B4X:
Private Sub B4XFloatTextField1_FocusChanged (HasFocus As Boolean)
    If HasFocus Then
        If B4XFloatTextField1.Text = "" Then
            B4XFloatTextField1.HintText = "Full name"
        Else
            B4XFloatTextField1.HintText = "Write your full name here Or John Smith"
        End If
    Else
        If B4XFloatTextField1.Text = "" Then
            B4XFloatTextField1.HintText = "Write your full name here Or John Smith"
        End If
    End If
    B4XFloatTextField1.Update
End Sub

Wow, yes Oparra, that is exactly what I mean.

Thank you very much.
 
Top