Private Sub txtName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtName.TextChanged
'upper case text
If blnNoEvents = True Then Exit Sub
blnNoEvents = True
txtName.Text = UCase(txtName.Text)
Dim ThisControl As New System.Windows.Forms.TextBox
Dim NetSelLength_int As Integer
Dim MyActiveForm As Form = System.Windows.Forms.Form.ActiveForm
ThisControl = MyActiveForm.ActiveControl
ThisControl.Text = MyActiveForm.ActiveControl.Text
NetSelLength_int = Len(txtName.Text) 'ThisControl.SelectionLength
ThisControl.SelectionStart = NetSelLength_int
blnNoEvents = False
End Sub