مرحبا بكم يا عشاق الإعلاميات أتمنى لكم أحلى اللحظات
le code de caluculatrice
au visual basic 6
Option Explicit
Private Sub Command1_Click()
On Error Resume Next
If Label1.Caption = "+" Then
Text1.Text = Val(Label2.Caption) + Text1.Text
End If
If Label1.Caption = "-" Then
Text1.Text = Val(Label2.Caption) - Text1.Text
End If
If Label1.Caption = "*" Then
Text1.Text = Val(Label2.Caption) * Text1.Text
End If
If Label1.Caption = "/" Then
Text1.Text = Val(Label2.Caption) / Text1.Text
End If
End Sub
Private Sub Command10_Click()
Text1.Text = Text1.Text + "9"
End Sub
Private Sub Command11_Click()
Text1.Text = Text1.Text + "8"
End Sub
Private Sub Command12_Click()
Text1.Text = Text1.Text + "7"
End Sub
Private Sub Command13_Click()
Text1.Text = Text1.Text + "6"
End Sub
Private Sub Command14_Click()
Text1.Text = Text1.Text + "5"
End Sub
Private Sub Command15_Click()
Text1.Text = Text1.Text + "0"
End Sub
Private Sub Command16_Click()
Text1.Text = ""
Label2.Caption = ""
End Sub
Private Sub Command2_Click()
Text1.Text = Text1.Text + "4"
End Sub
Private Sub Command3_Click()
On Error Resume Next
Label1.Caption = ""
Label1.Caption = "+"
Label2.Caption = Text1.Text
Text1.Text = ""
End Sub
Private Sub Command4_Click()
On Error Resume Next
Label1.Caption = ""
Label1.Caption = "-"
Label2.Caption = Text1.Text
Text1.Text = ""
End Sub
Private Sub Command5_Click()
On Error Resume Next
Label1.Caption = ""
Label1.Caption = "*"
Label2.Caption = Text1.Text
Text1.Text = ""
End Sub
Private Sub Command6_Click()
On Error Resume Next
Label1.Caption = ""
Label1.Caption = "/"
Label2.Caption = Text1.Text
Text1.Text = ""
End Sub
Private Sub Command7_Click()
Text1.Text = Text1.Text + "3"
End Sub
Private Sub Command8_Click()
Text1.Text = Text1.Text + "2"
End Sub
Private Sub Command9_Click()
Text1.Text = Text1.Text + "1"
End Sub
Private Sub Form_Load()
Label3.Caption = Date
Label4.Caption = Time
Label5.Caption = "el amrani"
End Sub