tufanv Expert Licensed User Longtime User Jan 29, 2014 #1 Hello, let say that i have a textbox. In the text box "Welcome" . When the user use backspace to delete a letter i want the textbox to be " " (delete everything). Shortly he wont be able to have welcom or welco or welc .. in the text box he will have welcome or nothing. ( means i want to clear textbox when any of the letters are deleted) Any way to do it ? ty
Hello, let say that i have a textbox. In the text box "Welcome" . When the user use backspace to delete a letter i want the textbox to be " " (delete everything). Shortly he wont be able to have welcom or welco or welc .. in the text box he will have welcome or nothing. ( means i want to clear textbox when any of the letters are deleted) Any way to do it ? ty
stevel05 Expert Licensed User Longtime User Jan 29, 2014 #2 I think you may want to set "Welcome" as a hint for the EditText. Then when they start typing the Welcome will disappear. Upvote 0
I think you may want to set "Welcome" as a hint for the EditText. Then when they start typing the Welcome will disappear.
DonManfred Expert Licensed User Longtime User Jan 29, 2014 #3 stevel05 said: I think you may want to set "Welcome" as a hint for the EditText Click to expand... AND set the EditText.Text to "" (empty string) Upvote 0
stevel05 said: I think you may want to set "Welcome" as a hint for the EditText Click to expand... AND set the EditText.Text to "" (empty string)
LucaMs Expert Licensed User Longtime User Jan 29, 2014 #4 Try so (I have not tried it) Code: Sub EditText1_TextChanged (Old As String, New As String) If Old.IndexOf(New) = 0 AND Old.Length = New.Length + 1 Then EditText1.Text = "" End If End Sub (intercept the Backspace key on EditText (probably this can be achieved using Reflection) would be better) Upvote 0
Try so (I have not tried it) Code: Sub EditText1_TextChanged (Old As String, New As String) If Old.IndexOf(New) = 0 AND Old.Length = New.Length + 1 Then EditText1.Text = "" End If End Sub (intercept the Backspace key on EditText (probably this can be achieved using Reflection) would be better)
DonManfred Expert Licensed User Longtime User Jan 29, 2014 #5 Luca, it is really not needed to do such workaround... The TO should just set the "Welcome" into the EditText.Hint and leave the EditText-field empty. So your woraround it not needed in TextChanged-sub Upvote 0
Luca, it is really not needed to do such workaround... The TO should just set the "Welcome" into the EditText.Hint and leave the EditText-field empty. So your woraround it not needed in TextChanged-sub
LucaMs Expert Licensed User Longtime User Jan 29, 2014 #6 The Hint disappears when you beat the first key, but maybe I misunderstood the question (write in Italian, please ) Upvote 0
The Hint disappears when you beat the first key, but maybe I misunderstood the question (write in Italian, please )
LucaMs Expert Licensed User Longtime User Jan 29, 2014 #7 LucaMs said: The Hint disappears when you beat the first key, but maybe I misunderstood the question (write in Italian, please ) Click to expand... Late, but I understood. He needs just the Hint! Wake up, Luca Upvote 0
LucaMs said: The Hint disappears when you beat the first key, but maybe I misunderstood the question (write in Italian, please ) Click to expand... Late, but I understood. He needs just the Hint! Wake up, Luca