Sub Globals
Dim EditText1 As EditText
Dim EditText2 As EditText
Dim booleanIgnoreChange As Boolean
End Sub
Sub Activity_Create(FirstTime As Boolean)
EditText1.Initialize ("EditText1")
Activity.AddView (EditText1, 10%x, 10%y, 80%x, 150dip)
EditText2.Initialize ("EditText2")
Activity.AddView (EditText2, 10%x, 10%y + 200dip, 80%x, 50dip)
End Sub
Sub Activity_Resume
EditText1.Text = "This is a very important text"
EditText2.Text = "Not a very important text"
End Sub
Sub EditText1_TextChanged (Old As String, New As String)
If booleanIgnoreChange = False Then
booleanIgnoreChange = True
Dim i As Int = EditText1.SelectionStart
Dim j As Int = EditText1.SelectionLength
EditText1.Text = (EditText1.Text).ToUpperCase
EditText1.SetSelection (i, j)
Else
booleanIgnoreChange = False
End If
End Sub