Code source d'une calculatrice scientifique

Messages postés
8
Date d'inscription
jeudi 3 mars 2011
Statut
Membre
Dernière intervention
28 mars 2011
- - Dernière réponse : badbadtoo
Messages postés
8
Date d'inscription
jeudi 3 mars 2011
Statut
Membre
Dernière intervention
28 mars 2011
- 28 mars 2011 à 14:14
veuillez me corriger ce code vb.net 2008 svp


Public Class Form1
Dim A As Double
Dim B As Double
Dim F As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = TextBox1.Text + "7"

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = TextBox1.Text + "8"
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.Text = TextBox1.Text + "9"
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TextBox1.Text = TextBox1.Text + "4"
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
TextBox1.Text = TextBox1.Text + "5"
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
TextBox1.Text = TextBox1.Text + "6"
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
TextBox1.Text = TextBox1.Text + "1"
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
TextBox1.Text = TextBox1.Text + "2"
End Sub

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
TextBox1.Text = TextBox1.Text + "3"
End Sub

Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
TextBox1.Text = TextBox1.Text + "0"
End Sub

Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
TextBox1.Text = TextBox1.Text + "."
End Sub

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
TextBox1.Text = ""
End Sub

Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button22.Click
Close()
Afficher la suite 

5 réponses

Messages postés
3247
Date d'inscription
jeudi 26 novembre 2009
Statut
Membre
Dernière intervention
26 décembre 2018
46
0
Merci
Salut

veuillez me corriger ce code vb.net 2008 svp



à votre service
c'est tout ? il y a aussi du tout cuit + une prime d'encouragement
Commenter la réponse de cs_ShayW
Messages postés
8
Date d'inscription
jeudi 3 mars 2011
Statut
Membre
Dernière intervention
28 mars 2011
0
Merci
SALUT

EXCUSE MOI SE N'AI PAS TT
VOLA LE CODE COMPLET :
JE PENSE QUE LE PROB SE TROUVE DANS LES BOUTONS : DEL-PI-DEG . NORMALEMENT VEUILLEZ ESSAIE TOUT LES FONCTION SVP
ICI LE CODE :

Public Class Form1
Dim A As Double
Dim B As Double
Dim F As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = TextBox1.Text + "7"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = TextBox1.Text + "8"
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.Text = TextBox1.Text + "9"
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TextBox1.Text = TextBox1.Text + "4"
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
TextBox1.Text = TextBox1.Text + "5"
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
TextBox1.Text = TextBox1.Text + "6"
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
TextBox1.Text = TextBox1.Text + "1"
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
TextBox1.Text = TextBox1.Text + "2"
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
TextBox1.Text = TextBox1.Text + "3"
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
TextBox1.Text = TextBox1.Text + "0"
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
TextBox1.Text = TextBox1.Text + "."
End Sub

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
TextBox1.Text = ""
End Sub
Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button22.Click
Close()
End Sub
Private Sub Button26_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button26.Click
A = Val(TextBox1.Text)
TextBox1.Clear()
F = "+"
End Sub
Private Sub Button25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button25.Click
A = Val(TextBox1.Text)
TextBox1.Clear()
F = "-"
End Sub
Private Sub Button24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button24.Click
A = Val(TextBox1.Text)
TextBox1.Clear()
F = "*"
End Sub
Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button23.Click
A = Val(TextBox1.Text)
TextBox1.Clear()
F = "/"
End Sub
Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button19.Click
TextBox1.Text = TextBox1.Text + "("
End Sub
Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button20.Click
TextBox1.Text = TextBox1.Text + ")"
End Sub
Private Sub Button27_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button27.Click
B = Val(TextBox1.Text)
TextBox1.Clear()
If F = "+" Then
TextBox1.Text = A + B
End If
If F = "-" Then
TextBox1.Text = A - B
End If
If F = "*" Then
TextBox1.Text = A * B
End If
If F = "/" Then
TextBox1.Text = A / B
End If
End Sub
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
Dim sqr As Double
sqr = Math.Sqrt(TextBox1.Text)
TextBox1.Text = sqr
End Sub
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
Dim r As Double
r = (TextBox1.Text) ^ 2
TextBox1.Text = r
End Sub
Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
Dim Sinus As Single
Sinus = Math.Sin(TextBox1.Text)
TextBox1.Text = Sinus
End Sub
Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
Dim cosinus As Single
cosinus = Math.Cos(TextBox1.Text)
TextBox1.Text = cosinus
End Sub
Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
Dim tang As Double
tang = Math.Tan(TextBox1.Text)
TextBox1.Text = tang
End Sub
Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
Dim log As Double
log = Math.Log10(TextBox1.Text)
TextBox1.Text = log
End Sub
Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
Dim expon As Double
expon = Math.Exp(TextBox1.Text)
TextBox1.Text = expon
End Sub
Private Sub Button30_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button30.Click
End Sub
Private Sub Button29_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button29.Click
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub GroupBox2_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox2.Enter
End Sub
End Class
Commenter la réponse de badbadtoo
Messages postés
423
Date d'inscription
vendredi 17 novembre 2006
Statut
Membre
Dernière intervention
15 juillet 2014
4
0
Merci
Renommez Button19 en Button65 et tout rentre dans l'ordre.

A moins que ce soit Button25 en Button38 ... Je suis pas sur ....

Heureusement qu'une calculatrice n'a que 10 chiffres.

Si c'est pour un exercice d'école, ne cherchez pas l'erreur, recommencez d'une page blanche en faisant une vraie analyse, sinon c'est la mauvaise note assurée.

Les forums sont fait pour aider les gens, pas pour faire leur travail.

;)
Commenter la réponse de foliv57
Messages postés
3247
Date d'inscription
jeudi 26 novembre 2009
Statut
Membre
Dernière intervention
26 décembre 2018
46
0
Merci
NORMALEMENT VEUILLEZ ESSAIE TOUT LES FONCTION SVP

On ne va pas faire le travail pour toi
les membres du forum ne sont pas payés à la piece
décris le ou les problèmes

c'est un code que tu as trouvé ?
l'as tu testé ?
Commenter la réponse de cs_ShayW
Messages postés
8
Date d'inscription
jeudi 3 mars 2011
Statut
Membre
Dernière intervention
28 mars 2011
0
Merci
لا تقلقوا
أنا لا اعمل البرمجة
فقط أحد أخوتي هو صاحب هذا التمرين’ فطلب مني المساعدة,فطلبتها منكم
ca se n'ai pas mon travail ......... selement c'est mon frere qui me domande ca et je ne sais pas dans le vb.net
Commenter la réponse de badbadtoo