Et nyt Cosinus problem!
Så er jeg her igen! jeg ved ikke hvad jeg har gjort forkert men min cosinus funktion virker ikke:Dim thetal As Double
Dim foerstetal As Double
Dim pluseller As String
Dim myAngle As Double
Dim mySecant As Double
Private Sub Command1_Click() //Det her er cosinus knappen!
method.Caption = \"Cos\"
End Sub
Private Sub Divider_Click()
pluseller = \"/\"
foerstetal = tal.Text
tal.Text = \"\"
End Sub
Private Sub Equal_Click()
Dim resultat As Double
If pluseller = \"+\" Then
resultat = foerstetal + tal.Text
End If
If pluseller = \"-\" Then
resultat = foerstetal - tal.Text
End If
If pluseller = \"*\" Then
resultat = foerstetal * tal.Text
End If
If pluseller = \"/\" Then
resultat = foerstetal / tal.Text
End If
If method.Caption = \"Cos\" Then
mySecant = foerstetal / Cos(tal.Text)
MsgBox mySecant
End If
tal.Text = resultat
End Sub
Private Sub Et_Click()
If tal.Text = \"\" Then
tal.Text = 1
Else
tal.Text = tal.Text & 1
End If
End Sub
Private Sub Fem_Click()
If tal.Text = \"\" Then
tal.Text = 5
Else
tal.Text = tal.Text & 5
End If
End Sub
Private Sub Fire_Click()
If tal.Text = \"\" Then
tal.Text = 4
Else
tal.Text = tal.Text & 4
End If
End Sub
Private Sub Form_Load()
tal.Text = \"\"
End Sub
Private Sub Gange_Click()
pluseller = \"*\"
foerstetal = tal.Text
tal.Text = \"\"
End Sub
Private Sub Minus_Click()
pluseller = \"-\"
foerstetal = tal.Text
tal.Text = \"\"
End Sub
Private Sub Ni_Click()
If tal.Text = \"\" Then
tal.Text = 9
Else
tal.Text = tal.Text & 9
End If
End Sub
Private Sub Otte_Click()
If tal.Text = \"\" Then
tal.Text = 8
Else
tal.Text = tal.Text & 8
End If
End Sub
Private Sub Plus_Click()
pluseller = \"+\"
foerstetal = tal.Text
tal.Text = \"\"
End Sub
Private Sub Reset_Click()
tal.Text = \"\"
End Sub
Private Sub Seks_Click()
If tal.Text = \"\" Then
tal.Text = 6
Else
tal.Text = tal.Text & 6
End If
End Sub
Private Sub Syv_Click()
If tal.Text = \"\" Then
tal.Text = 7
Else
tal.Text = tal.Text & 7
End If
End Sub
Private Sub To_Click()
If tal.Text = \"\" Then
tal.Text = 2
Else
tal.Text = tal.Text & 2
End If
End Sub
Private Sub Tre_Click()
If tal.Text = \"\" Then
tal.Text = 3
Else
tal.Text = tal.Text & 3
End If
End Sub
Er der et eller andet jeg har glemt at includere??
Det kan godt være at det virker lidt uoverskueligt men jeg er stadig ny i VB!!
På forhand tak!
