Home Game Overview Download About

Visual Basic 10 Scientific Calculator Code [ BEST · 2027 ]

Private Sub btn7_Click(sender As Object, e As EventArgs) Handles btn7.Click txtDisplay.Text &= "7" End Sub

Private Sub btn6_Click(sender As Object, e As EventArgs) Handles btn6.Click txtDisplay.Text &= "6" End Sub Visual Basic 10 Scientific Calculator Code

The scientific function buttons ( btnSin , btnCos , btnTan , btnExp , btnLog ) evaluate the corresponding mathematical function using the Math class. Private Sub btn7_Click(sender As Object, e As EventArgs)

Below is the complete code for the scientific calculator: Private Sub btn7_Click(sender As Object

Private Sub btnSin_Click(sender As Object, e As EventArgs) Handles btnSin.Click Try Dim angle As Double = Convert.ToDouble(txtDisplay.Text) Dim result As Double = Math.Sin(angle * Math.PI / 180) txtDisplay.Text = result.ToString() Catch ex As Exception txtDisplay.Text = "Error" End Try End Sub