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
| ' Gambas class file
PUBLIC hConsoleTimer AS Timer PUBLIC siCount AS SHORT PUBLIC iTemp AS INTEGER
PUBLIC SUB Timer1_Timer()
ProgressBar1.Visible = TRUE INC siCount ProgressBar1.value = siCount / iTemp IF siCount = iTemp THEN ME.Close ENDIF
END
PUBLIC SUB btnDemarrer_Click()
hConsoleTimer.Enabled = TRUE
END
PUBLIC SUB Form_Close()
hConsoleTimer.Stop 'on arrête le timer hConsoleTimer = NULL 'on nettoie ProgressBar1 = NULL
END
PUBLIC SUB Form_Open()
hConsoleTimer = NEW Timer AS "Timer1" 'création du timer hConsoleTimer.Delay = 1 'delay pour la boucle évènement (1 milliseconde) iTemp = 5000
END
|