Bonjour,

J'ai un petit problème dans mon code, j'ai cherché pas mal mais je n'y trouve rien comme je suis débutant.

Je doute de la syntaxe et la structure des données ...

Voici mon code

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
 
Private Sub cmdcalculer_Click()
 
Dim lgrf As Single
Dim diffhauteur As Single
Dim difflargeur As Single
 
diffhauteur = (txthtf.Text - lblrslthb)
difflargeur = (txtlgrf.Text - lblrsltlb)
lblrslthb.Caption = txtlgrf.Text
lblrsltlb.Caption = (txtlgrf.Text / 3) * 2
 
lblmrgIres.Caption = ((txtlgrf.Text - lblrsltlb) / 6 * 2)
lblmrgEres.Caption = ((txtlgrf.Text - lblrsltlb) / 6 * 4)
lblmrgTres.Caption = ((txthtf.Text - lblrslthb) / 9 * 3)
lblmrgPres.Caption = ((txthtf.Text - lblrslthb) / 9 * 6)
 
lbldiffreshauteur.Caption = txthtf.Text - lblrslthb
lbldiffreslargeur.Caption = txtlgrf.Text - lblrsltlb
End Sub
Je ne sais toujours pas exactement déclarer les variables même si je suis un livre ....

Si quelqu'un pourrait m'éclaircir à ce sujet où m'apporter une modification favorable dans mon code, ce serait sympa ^^

Merci d'avance pour vos réponses