CURSOR NO FINAL DO TEXTO
                    bom eu tenho a seguinte funcao para formatar um cpf
o problema é o seguinte cada vez que eu passo em alguns dos ifs o cursor(focu) do text1.test fica no inicio do codigo (cpf) que eu estou digitando
tem como eu deixa-lo no final do codigo(cpf) ??
agradeco desde já
            
Public var
Private Sub Text1_Change()
If (Len(Text1.Text) = 3) Then
   Text1.Text = Text1.Text + "."
   Else
     If (Len(Text1.Text) = 7) Then
         Text1.Text = Text1.Text + "."
          Else
            If (Len(Text1.Text) = 11) Then
                Text1.Text = Text1.Text + "-"
                Text1.SetFocus
               Else
               If (Len(Text1.Text) = 15) Then
                Text1.Text = var
                MsgBox ("impossivel")
               End If
          End If
            
    End If
End If
var = Text1.Text
End Subo problema é o seguinte cada vez que eu passo em alguns dos ifs o cursor(focu) do text1.test fica no inicio do codigo (cpf) que eu estou digitando
tem como eu deixa-lo no final do codigo(cpf) ??
agradeco desde já
Text1.SelStart = Len(Text1.Text)
Dim var
Private Sub Text1_Change()
If (Len(Text1.Text) = 3) Then
Text1.Text = Text1.Text + "."
Text1.SelStart = Len(Text1.Text)
Else
If (Len(Text1.Text) = 7) Then
Text1.Text = Text1.Text + "."
Text1.SelStart = Len(Text1.Text)
Else
If (Len(Text1.Text) = 11) Then
Text1.Text = Text1.Text + "-"
Text1.SelStart = Len(Text1.Text)
Text1.SetFocus
Else
If (Len(Text1.Text) = 15) Then
Text1.Text = var
Text1.SelStart = Len(Text1.Text)
MsgBox ("impossivel")
End If
End If
End If
End If
var = Text1.Text
End Sub
                        Tópico encerrado , respostas não são mais permitidas
                    
                
