rss
comment faire une calculatrice avec vb
par Aymen
 Fil de Discussions
Statut : Non résolu
vendredi 17 juin 2005 à 16:48:34
salut je me demande comment faire une calculatrice avec visual basic
Répondre à Aymen  Signaler ce message aux modérateurs Aller au dernier message

1


  • Ce message vous semble utile, votez !
  • Signaler ce message aux modérateurs
Par random, le vendredi 17 juin 2005 à 16:53:29 Fil de Discussions
tu cres un frame avec un groupe de bouton pour les chiffres
et un autre pour les oprations
un venement sur appui bouton va inscrire la fin d'une zone texte
le chiffre correspondant au bouton press
l'appui sur une touche opration va librer l'opration en cours
et nourrir un compteur de rsultat intercalaire
l'appui sur gal vide tout et affiche rsultat
elleestpasbelle,lavie?
Répondre à random

2


  • Ce message vous semble utile, votez !
  • Signaler ce message aux modérateurs
Par tony, le vendredi 17 juin 2005 à 17:02:07 Fil de Discussions
vous voulez pas kon vous ponde votre programme en entier pdt que vous y tes !!!!

rflchissez un peu votre problme avant de poster vos messages!! on vous aidera si vous bloquez sur une partie de votre code !!!!

bon courage

tony
Répondre à tony

3


  • Ce message vous semble utile, votez !
  • Signaler ce message aux modérateurs
Par khadija, le samedi 10 fvrier 2007 à 13:36:37 Fil de Discussions
comment faire un calculatrice
Répondre à khadija

4


  • Ce message vous semble utile, votez !
  • Signaler ce message aux modérateurs
Par khadija, le samedi 10 fvrier 2007 à 13:37:49 Fil de Discussions
Répondre à khadija

5


  • 4
    Ce message vous semble utile, votez !
  • Ce message ne vous semble pas utile, votez !
  • Signaler ce message aux modérateurs
Par walid524, le samedi 10 fvrier 2007 à 14:29:29 Fil de Discussions
Dim S1 As Double '2me operande
Dim S2 As Double '1er operande
Dim Oper As Integer 'indique la nature de l'operation a faire.On en aura besoin dans le Egal_Click()
Dim Oper2 As Boolean 'Indique s'il y'a 2 operateurs ou 1 seul
Dim Xbase As Integer


'a c'est pour le boutton +
Private Sub Add_Click()
Oper = 1
If Oper2 = False Then
S2 = S1
S1 = 0
Oper2 = True
End If
End Sub

'a c'est pour le boutton 1
Private Sub B1_Click()
S1 = S1 * 10 + 1
Val.Text = S1
End Sub


vous de jouer maintenant
Répondre à walid524

6


  • Ce message vous semble utile, votez !
  • Signaler ce message aux modérateurs
Par Hicham, le jeudi 5 avril 2007 à 19:29:12 Fil de Discussions
ben jvous conseil ce site et vous trouverez tout dont vous av besoin et la prochaine il faut etre capabl tt seul voila le site : www.vbfrance.com/gma/calculatrice
Répondre à Hicham

7


  • Ce message vous semble utile, votez !
  • Signaler ce message aux modérateurs
Par Mario1095, le dimanche 23 septembre 2007 à 11:24:29 Fil de Discussions
Ca fonctionne avec VBA ???
Répondre à Mario1095

8


  • Ce message vous semble utile, votez !
  • Signaler ce message aux modérateurs
Par smi, le dimanche 30 mars 2008 à 15:08:37 Fil de Discussions
svp si vous pourriez m'aider pour creer un programme window en VB(calculatrice) ca ser sympa de votre part et marci d'avance
Répondre à smi

9


  • Ce message vous semble utile, votez !
  • Signaler ce message aux modérateurs
Par isaacfromorocco, le jeudi 19 juin 2008 à 22:10:08 Fil de Discussions 
Voici le code d'une calculatrice ke jai cre mais apre c les command originale ke jai utiliser jai pa changer le caption vous pouver cre une calculatrice avec se code je veu dire le meme mais fai attention les buttons doient etre les meme :)

command1 c'est le bouton 1 remarque: byteoperation = 0 sa veu dire ona pa encore click a aucune operation
+ - * ou /
command2 c'est le bouton 2 byteoperation = 1 veu dire kona click sur une operation
typeoperation = 1 ca veu dire c loperation +
...................................... typeoperation = 2 c loperation - typeoperation= 3 c * et typeoperation=4 c /
...................................
.......................................
....................................
.....................................
.....................................
.......................................
command10 c'est le bouton 0
-----------------------------------------
command11 c'est le boutton C (effacer)
command12 c'est le button (+)
command13 c'est le button (-)
command14 c'est le button (*)
command15 c'est le button (/)
command16 c'est le button (=)
------------------------------------------------------------------------------------------­------------------
(voici le code)

Dim byteoperation As Byte
Dim typeoperation As Byte
Dim nbr1 As Double
Dim nbr2 As Double
Dim nbr3 As Double

Private Sub Command1_Click()
If byteoperation = 0 Then
Text1.Text = Text1.Text + Str(1)
Else
Text1.Text = Str(1)
byteoperation = 0
End If
End Sub

Private Sub Command10_Click()
If byteoperation = 0 Then
Text1.Text = Text1.Text + Str(0)
Else
Text1.Text = Str(0)
byteoperation = 0
End If
End Sub

Private Sub Command11_Click()
Text1.Text = ""
End Sub

Private Sub Command12_Click()
byteoperation = 1
typeoperation = 1
nbr1 = Text1.Text
End Sub

Private Sub Command13_Click()
byteoperation = 1
typeoperation = 2
nbr1 = Text1.Text
End Sub

Private Sub Command14_Click()
byteoperation = 1
typeoperation = 3
nbr1 = Text1.Text
End Sub

Private Sub Command15_Click()
byteoperation = 1
typeoperation = 4
nbr1 = Text1.Text
End Sub

Private Sub Command16_Click()
nbr2 = Text1.Text
If typeoperation = 1 Then
nbr3 = nbr1 + nbr2
Text1.Text = Val(nbr3)

End If
nbr2 = Text1.Text
If typeoperation = 2 Then
nbr3 = nbr1 - nbr2
Text1.Text = Val(nbr3)
End If
nbr2 = Text1.Text
If typeoperation = 3 Then
nbr3 = nbr1 * nbr2
Text1.Text = Val(nbr3)
End If

nbr2 = Text1.Text
If typeoperation = 4 Then
nbr3 = nbr1 / nbr2
Text1.Text = Val(nbr3)
End If
End Sub

Private Sub Command2_Click()
If byteoperation = 0 Then
Text1.Text = Text1.Text + Str(2)
Else
Text1.Text = Str(2)
byteoperation = 0
End If
End Sub

Private Sub Command3_Click()
If byteoperation = 0 Then
Text1.Text = Text1.Text + Str(3)
Else
Text1.Text = Str(3)
byteoperation = 0
End If
End Sub

Private Sub Command4_Click()
If byteoperation = 0 Then
Text1.Text = Text1.Text + Str(4)
Else
Text1.Text = Str(4)
byteoperation = 0
End If
End Sub

Private Sub Command5_Click()
If byteoperation = 0 Then
Text1.Text = Text1.Text + Str(5)
Else
Text1.Text = Str(6)
byteoperation = 0
End If
End Sub

Private Sub Command6_Click()
If byteoperation = 0 Then
Text1.Text = Text1.Text + Str(6)
Else
Text1.Text = Str(6)
byteoperation = 0
End If
End Sub

Private Sub Command7_Click()
If byteoperation = 0 Then
Text1.Text = Text1.Text + Str(7)
Else
Text1.Text = Str(7)
byteoperation = 0
End If
End Sub

Private Sub Command8_Click()
If byteoperation = 0 Then
Text1.Text = Text1.Text + Str(8)
Else
Text1.Text = Str(8)
byteoperation = 0
End If
End Sub

Private Sub Command9_Click()
If byteoperation = 0 Then
Text1.Text = Text1.Text + Str(9)
Else
Text1.Text = Str(9)
byteoperation = 0
End If
End Sub
Répondre à isaacfromorocco
Discussions pertinentes trouvées dans le forum
12/04 05h00VBA calculatriceProgrammation12/04 22h453
28/03 00h41cration d'une calculatrice en vb.netProgrammation24/06 21h582
23/12 12h29[VB6] CalculatriceProgrammation30/01 15h183
17/08 13h47VB:interface graphique d'une calculatriceProgrammation30/04 13h056
Plus de discussions sur « comment faire une calculatrice avec vb » Discussion en cours Discussion fermée Problème résolu
Répondre
Titre du message :
Votre pseudo:
Votre email :
Message: 
  •  
  •  
Options: Recevoir les réponses par mail.
 

Aide