Copier serie

Description

Cette source permet de copier une zone de texte vers une
autre application qui était active avant.
Assez utile pour les réinstallation.

Source / Exemple :


Option Explicit
Private pos_key As Integer
Private time As Integer

Private Sub Commandbutton1_Click()
Timer1.Enabled = True
End Sub

Private Sub Form_Load()
pos_key = 1
time = 1
Combo1.ListIndex = 1
End Sub

Private Sub Text1_Change()
If Check3 And Text1 <> "" Then: Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Dim txt As String
1:
If Text1 <> "" And time > 2 * Combo1.ListIndex Then
    If pos_key <= Len(Text1.Text) Then
        
        If pos_key = 1 Then
            If Check2 Then
                SendKeys "%{TAB}"
            End If
            Timer1.Interval = 50
            Text1.Enabled = False
        End If
        txt = Mid(Text1, pos_key, 1)
        If Check1 Then
            If txt <> "-" And txt <> " " Then
                SendKeys txt
            End If
        Else
            SendKeys txt
        End If
        pos_key = pos_key + 1
    Else
        pos_key = 1
        Timer1.Interval = 500
        Timer1.Enabled = False
        Text1.Enabled = True
        time = 1
        'MsgBox Len(Text1)
    End If
Else
    If Text1 = "" Then
        time = 1
        Timer1.Enabled = False
    Else
    time = time + 1
    End If
End If
End Sub

Conclusion :


Niveau débutant.

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.