comment créer une calculatrice _visual basic_
projet calculatrice simple
Private Sub
CommandButton1_Click()
Dim var1 as integer;
Dim var2 as integer;
Image1.Visible = False;
Image2.Visible = False;
Image3.Visible = False;
Image4.Visible = False;
Image5.Visible = False;
Image6.Visible = False;
var1 =
Val(TextBox1.Text);
var2 =
Val(TextBox2.Text);
TextBox3.Value = var1
+ var2;
End Sub
Private Sub
CommandButton2_Click()
Dim var1 as integer;
Dim var2 as integer;
Image1.Visible = False;
Image2.Visible = False;
Image3.Visible = False;
Image4.Visible = False;
Image5.Visible = False;
Image6.Visible = False;
var1 =
Val(TextBox1.Text);
var2 =
Val(TextBox2.Text);
TextBox3.Value = var1 - var2;
End Sub
Private Sub
TextBox3_Change()
If TextBox3 = 1 Then
Image1.Visible = True;
End If
If TextBox3 = 2 Then
Image1.Visible = True;
Image2.Visible = True;
End If
If TextBox3 = 3 Then
Image1.Visible = True;
Image2.Visible = True;
Image3.Visible = True;
End If
If TextBox3 = 4 Then
Image1.Visible = True;
Image2.Visible = True;
Image3.Visible = True;
Image4.Visible = True;
End If
If TextBox3 = 5 Then
Image1.Visible = True;
Image2.Visible = True;
Image3.Visible = True;
Image4.Visible = True;
Image5.Visible = True;
End If
If TextBox3 = 6 Then
Image1.Visible = True;
Image2.Visible = True;
Image3.Visible = True;
Image4.Visible = True;
Image5.Visible = True;
Image6.Visible = True;
End If
End Sub
Private Sub
CommandButton3_Click()
End
End Sub
Commentaires
Enregistrer un commentaire