Private Sub btnTan_Click(sender As Object, e As EventArgs) Handles btnTan.Click Try Dim angle As Double = Convert.ToDouble(txtDisplay.Text) Dim result As Double = Math.Tan(angle * Math.PI / 180) txtDisplay.Text = result.ToString() Catch ex As Exception txtDisplay.Text = "Error" End Try End Sub
Private Sub btn5_Click(sender As Object, e As EventArgs) Handles btn5.Click txtDisplay.Text &= "5" End Sub Visual Basic 10 Scientific Calculator Code
The scientific calculator will have a user-friendly interface with buttons for digits 0-9, four arithmetic operations (+, -, *, /), and various scientific functions (sin, cos, tan, exp, log, etc.). The calculator will display the results in a text box. Private Sub btnTan_Click(sender As Object, e As EventArgs)