Bonjour à tous

Mon but est de lancer un opération de téléchargement en arrière plan à intervalle régulier.
Dans ma séquence je démarre un timer et je lance un sub en arrière plan
mon problème c'est que je suis incappable de relancer le timer un coup l'opération terminé

je sais pas si j'ai la bonne démarche mais voici ce que j'ai pour le moment
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'Dans la section déclaration
    Delegate Sub TraitAsync(ByVal comp As Integer)
    Dim Ta As New TraitAsync(AddressOf Traitement1)
    Dim Iar As IAsyncResult
 
Sub Traitement1(ByVal Int As Integer)
        Console.WriteLine("Passe ici ")
 
        Dim Int1 As Integer = 0
        Do Until Int1 = 10
            Thread.Sleep(1000)
 
            Console.WriteLine(Int1)
            Int1 += 1
        Loop
        'Timer1.Start()
    End Sub
 
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
 
        Int2 += 1
        If Int2 = 5 Then
            Timer1.Stop()
            Int2 = 0
            Iar = Ta.BeginInvoke(5, AddressOf AffResult, Nothing)
            Console.WriteLine("Ttttermine")
            'Timer1.Start()
        End If
 
 
        Console.WriteLine("Thick")
        'Button1.PerformClick()
    End Sub
 
Sub AffResult(ByVal iar As IAsyncResult)
        If iar.IsCompleted Then
            Console.WriteLine("passe ici iar")
            Timer1.Start()
        End If
 
        'Console.WriteLine(Ta.EndInvoke())
    End Sub
Merci de vos suggestions

Thick
Thick
Thick
Thick
Ttttermine
Thick
Passe ici
0
1
2
3
4
5
6
7
8
9
passe ici iar
j'ai dans l'idée de me faire une variable string et de créer un évenement textchange

y aurait t'il plus simple?