Gambas France BETA


Pas de compte ? Incription

essaisdivers

À propos de ce code

Faire bouger du texte.....

Supposons :
un anniversaire a rappeler, on fait défiler le text x jours avant l'anniversaire
le jour anniversaire, on fait clignoter le text

Code source

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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
' Gambas class file

PUBLIC Plus AS FLOAT
PUBLIC Moins AS FLOAT

PUBLIC SUB Form_Open()
Plus = 1.1
Moins = 1
ME.Center
ME.Title = "Essais divers " & Application.Path
END
PUBLIC SUB Button_cli_Click()
Timer2.Enabled = FALSE
Timer1.Enabled = TRUE
END

PUBLIC SUB Button_def_Click()
Timer1.Enabled = FALSE
TextB_CliDef.Text = "--Vous avez appuyez sur le bouton <defilement>-- " 'bizarre si on met défil
Timer2.Enabled = TRUE
Timer2_Timer
ME.Title = Button_def.Caption
END

PUBLIC SUB Timer1_Timer()
FMain.Title = Button_cli.Caption
TextB_CliDef.Text = "--Vous avez appuyez sur le bouton <Clignotement>--!"
TextB_CliDef.Foreground = &00000000& 'on peut faire Background aussi
WAIT Moins
TextB_CliDef.Foreground = &00ff00000&
WAIT Plus
TextB_CliDef.Foreground = &00000000&
CATCH
END

PUBLIC SUB Timer2_Timer()
DIM L1 AS STRING ' first
DIM L2 AS STRING ' next

TextB_CliDef.Foreground = &00FFFF00&
L1 = Left(TextB_CliDef.Text, 1)
L2 = Right(TextB_CliDef.Text, Len(TextB_CliDef.Text) - 1)
TextB_CliDef.Text = L2 & L1
END

PUBLIC SUB BtnByeBye_Click()
Timer1.Enabled = FALSE
Timer2.Enabled = FALSE
ME.Close
END

PUBLIC SUB BtnTimerPlus_Click()

Timer2.Delay = Timer2.Delay - 10
TextBox4.Text = Timer2.Delay
TextBox3.Text = ""
END

PUBLIC SUB BtnTimerMoins_Click()

Timer2.Delay = Timer2.Delay + 10
TextBox3.Text = Timer2.Delay
TextBox4.Text = ""
END

PUBLIC SUB BtnWaitPlus_Click()

Plus = Plus - 0.5
Moins = Moins - 0.1
TextBox1.Text = Plus
TextBox2.Text = Moins
END

PUBLIC SUB BtnWaitMoins_Click()
Plus = Plus + 0.5
Moins = Moins + 0.1
TextBox1.Text = Plus
TextBox2.Text = Moins
END

PUBLIC SUB TextB_CliDef_MouseDown()

Timer1.Enabled = FALSE
Timer2.Enabled = FALSE

END

PUBLIC SUB TextB_CliDef_DblClick()

Timer1.Enabled = TRUE
Timer2.Enabled = TRUE

END

Commentaires