Taschenrechner

Ein einfacher Taschenrechner mit wenigen Funktionen und einem Button zum übergeben eines Textes:

 

Quellcode:

Option Explicit 
Dim a As Double
Dim b As Double


Private Sub Command1_Click()
'a = Text1.Text
'b = Text2.Text
'Label1.Caption = a + b

Label1.Caption = Val(Text1.Text) + Val(Text2.Text)

End Sub


Private Sub Command2_Click()
a = Text1.Text
b = Text2.Text
Label1.Caption = a - b
End Sub


Private Sub Command3_Click()
a = Text1.Text
b = Text2.Text
Label1.Caption = a * b
End Sub


Private Sub Command4_Click()
a = Text1.Text
b = Text2.Text
If b = 0 Then
Label1.Caption = "Nicht /0 teilbar"
Else
Label1.Caption = a / b
End If
End Sub


Private Sub Command5_Click()
Text1.Text = 0
Text2.Text = 0
Label1.Caption = ""
End Sub


Private Sub Command6_Click()
a = Text1.Text
b = Text2.Text
Label1.Caption = a ^ b
End Sub


Private Sub Command7_Click()
a = Text1.Text
b = Text2.Text
Label1.Caption = a ^ 2
End Sub


Private Sub Command8_Click()
a = Text1.Text
Label1.Caption = a ^ (1 / 2)
End Sub


Private Sub Command9_Click()
a = Text1.Text
Label1.Caption = 1 / a
End Sub


Private Sub e_Click()
End
End Sub


Private Sub f_Click()
ausgabe.BackColor = &H8000000F
End Sub


Private Sub knopf_Click()
ausgabe.Caption = wort.Text
ausgabe.BackColor = wort.BackColor
End Sub


Private Sub q_Click()
ausgabe.Caption = wort.Text
End Sub


Private Sub Timer1_Timer()
If Label1.ForeColor = &H80000012 Then
Label1.ForeColor = &HFF&
Else
Label1.ForeColor = &H80000012
End If

End Sub

Zu kompliziert??
Dann Download als Projekt (1,85 KB)

  

Home << Schule << ITA-Mappe << Programmiertechnik Übersicht <<
Online: 1 | IP: | 22.11.2017 - 04:23:24  
©
Christian Klisch   - Alle Rechte vorbehalten - Impressum