Public Class Form1
Dim n As Long
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox2.Text = "" Then MsgBox("Введите первое число")
If TextBox3.Text = "" Then MsgBox("Введите второе число")
TextBox1.Text = Val(TextBox2.Text) + Val(TextBox3.Text)
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
If Len(TextBox2.Text) > 40 Then MsgBox("Много знаков")
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
If Len(TextBox2.Text) > 40 Then MsgBox("Много знаков")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox2.Text = "" Then MsgBox("Введите первое число")
If TextBox3.Text = "" Then MsgBox("Введите второе число")
TextBox1.Text = Val(TextBox2.Text) - Val(TextBox3.Text)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If TextBox2.Text = "" Then MsgBox("Введите первое число")
If TextBox3.Text = "" Then MsgBox("Введите второе число")
TextBox1.Text = Val(TextBox2.Text) * Val(TextBox3.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
If TextBox2.Text = "" Then MsgBox("Введите первое число")
If TextBox3.Text = "" Then MsgBox("Введите второе число")
If TextBox2.Text > 0 Then TextBox1.Text = Val(TextBox2.Text) / Val(TextBox3.Text)
If TextBox3.Text = 0 Then TextBox1.Text = "На нуль делить нельзя"
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
If TextBox2.Text = "" Then MsgBox("Введите число")
TextBox1.Text = Math.Sin(Val(TextBox2.Text))
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
If TextBox2.Text = "" Then MsgBox("Введите число")
TextBox1.Text = Math.Cos(Val(TextBox2.Text))
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
If TextBox2.Text = "" Then MsgBox("Введите число")
TextBox1.Text = Math.Tan(Val(TextBox2.Text))
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
If TextBox2.Text = "" Then MsgBox("Введите число")
TextBox1.Text = Math.Sqrt(Val(TextBox2.Text))
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
If TextBox2.Text = "" Then MsgBox("Введите число")
If TextBox3.Text = "" Then MsgBox("Введите Степень числа")
TextBox1.Text = Val(TextBox2.Text) ^ Val(TextBox3.Text)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
If TextBox2.Text = "" Then MsgBox("Введите число")
n = TextBox2.Text
TextBox1.Text = fakt(n)
End Sub
Function fakt(ByVal n)
If n = 1 Then fakt = 1 Else fakt = fakt(n - 1) * n
End Function
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
End Sub
End Class