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
| PUBLIC SUB Form_KeyPress() '<---------------------------------------' évènement saisie clavier
DIM vText AS VARIANT DIM cChiffres AS String[] = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ",","."] DIM cSignes AS String[] = ["+", "-", "*", "/"]
vText = Key.Text '<---------------------------------------------' touche pressée
IF vText = "." THEN vText = ","
IF Key.Code = key.Return OR Key.Code = key.Enter THEN btnEgal_Click() IF Key.Code = Key.Esc THEN btnCancel_Click() IF Key.Code = Key.Backspace OR Key.Code = Key.Delete THEN btnEffacer_Click()
IF cChiffres.Exist(vText) THEN LAST.text = vText Chiffres_Click() ENDIF
IF cSignes.Exist(vText) THEN LAST.text = vText Signes_Click() ENDIF
IF NOT cSignes.Exist(Key.Text) OR NOT cChiffres.Exist(Key.Text) THEN STOP EVENT '<-------------' Arrêt de l'évènement si la touche enfoncée n'appartient pas à cSignes ou à cChiffres
ME.Text = "Calculatrice ++"
END
|