P park jae hyun Member Licensed User Longtime User Jun 27, 2011 #1 Sub EditText1_TextChanged (Old As String, New As String) EditText1.Text= NumberFormat(EditText1.Text,1,0) EditText1.SelectionStart =EditText1.Text.Length End Sub Click to expand... Just wanted to display the amount I do not know. 1,000,000 Mark is doing in this ... vb are well on ... I am not here ... Please help.
Sub EditText1_TextChanged (Old As String, New As String) EditText1.Text= NumberFormat(EditText1.Text,1,0) EditText1.SelectionStart =EditText1.Text.Length End Sub Click to expand... Just wanted to display the amount I do not know. 1,000,000 Mark is doing in this ... vb are well on ... I am not here ... Please help.
K kickaha Well-Known Member Licensed User Longtime User Jun 27, 2011 #2 I do not fully understand what you are asking, but looking at your code I wonder if you are using the wrong event. "Sub EditText1_TextChanged" is called every time there is a change in EditText1, so every time you enter a digit it will be called. I think you may have meant to use the EnterPressed event. This runs when the user presses on the enter key or action key (Done or Next). Upvote 0
I do not fully understand what you are asking, but looking at your code I wonder if you are using the wrong event. "Sub EditText1_TextChanged" is called every time there is a change in EditText1, so every time you enter a digit it will be called. I think you may have meant to use the EnterPressed event. This runs when the user presses on the enter key or action key (Done or Next).
P park jae hyun Member Licensed User Longtime User Jun 27, 2011 #3 help When you enter the amount. Genetically programmed to automatically number are you doing out there is a comma. Example 1,000,000 Upvote 0
help When you enter the amount. Genetically programmed to automatically number are you doing out there is a comma. Example 1,000,000
K kickaha Well-Known Member Licensed User Longtime User Jun 27, 2011 #4 So you want the number without the "," separator? For this use NumberFormat2 Code: Copy EditText1.Text= NumberFormat2(EditText1.Text,1,0,0,False) Upvote 0
So you want the number without the "," separator? For this use NumberFormat2 Code: Copy EditText1.Text= NumberFormat2(EditText1.Text,1,0,0,False)
P park jae hyun Member Licensed User Longtime User Jun 27, 2011 #5 help Sub EditText1_TextChanged (Old As String, New As String) EditText1.Text= NumberFormat(EditText1.Text,1,0) -------------- EditText1.SelectionStart =EditText1.Text.Length End Sub Click to expand... EditText2.Text = NumberFormat (EditText1.Text, 1,0) -------------- EditText2.text => automatically as you enter here for 1,000 will be marked this way. But ... EditText1.text => This error will leave -------------- Last edited: Jun 28, 2011 Upvote 0
help Sub EditText1_TextChanged (Old As String, New As String) EditText1.Text= NumberFormat(EditText1.Text,1,0) -------------- EditText1.SelectionStart =EditText1.Text.Length End Sub Click to expand... EditText2.Text = NumberFormat (EditText1.Text, 1,0) -------------- EditText2.text => automatically as you enter here for 1,000 will be marked this way. But ... EditText1.text => This error will leave --------------
K kickaha Well-Known Member Licensed User Longtime User Jun 28, 2011 #7 I would help, but the language barrier is stopping me from understanding the problem :sign0013: Upvote 0
K kickaha Well-Known Member Licensed User Longtime User Jun 28, 2011 #8 I still think that changing EditText1.Text in the EditText1_TextChanged sub is leading to an infinite loop, which is why I suggested using the EditText1_EnterPressed sub. Upvote 0
I still think that changing EditText1.Text in the EditText1_TextChanged sub is leading to an infinite loop, which is why I suggested using the EditText1_EnterPressed sub.
P park jae hyun Member Licensed User Longtime User Jun 28, 2011 #9 help Good way to teach us. But ... I want real change. I would like to change the moment you enter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Speak English and I'm sorry.. ^ ^ Upvote 0
help Good way to teach us. But ... I want real change. I would like to change the moment you enter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Speak English and I'm sorry.. ^ ^
K kickaha Well-Known Member Licensed User Longtime User Jun 28, 2011 #10 Try this Code: Copy Sub EditText1_TextChanged (Old As String, New As String) If NumberFormat (Old.Replace (",","") ,1,0) = New Then Return EditText1.Text= NumberFormat(EditText1.Text.Replace (",",""),1,0) EditText1.SelectionStart =EditText1.Text.Length End Sub To go through it: First we check if there has been any changes, if not return. This avoids the infinite loop. Then we format the number in the box to have "," The ".Replace (",","") " is needed because when the editbox has a number with a "," in it, it does not convert to a number so we need to remove them, convert to a number then replace them! Upvote 0
Try this Code: Copy Sub EditText1_TextChanged (Old As String, New As String) If NumberFormat (Old.Replace (",","") ,1,0) = New Then Return EditText1.Text= NumberFormat(EditText1.Text.Replace (",",""),1,0) EditText1.SelectionStart =EditText1.Text.Length End Sub To go through it: First we check if there has been any changes, if not return. This avoids the infinite loop. Then we format the number in the box to have "," The ".Replace (",","") " is needed because when the editbox has a number with a "," in it, it does not convert to a number so we need to remove them, convert to a number then replace them!
P park jae hyun Member Licensed User Longtime User Jun 28, 2011 #11 Thank you very much. Thank you very much. Thank you very much. Thank you very much. Thank you very much. Thank you very much. Upvote 0
Thank you very much. Thank you very much. Thank you very much. Thank you very much. Thank you very much. Thank you very much.
K kickaha Well-Known Member Licensed User Longtime User Jun 28, 2011 #12 Glad I could (eventually) help. Upvote 0