Public Class Form1
Dim sonuc As Double
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
TextBox1.Enabled = True
TextBox2.Enabled = False
TextBox3.Enabled = False
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
TextBox1.Enabled = True
TextBox2.Enabled = True
TextBox3.Enabled = False
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
TextBox3.Enabled = True
TextBox1.Enabled = False
TextBox2.Enabled = False
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If RadioButton1.Checked = True Then
sonuc = TextBox1.Text ^ 2
MsgBox("Karenin Alan = " & sonuc)
End If
If RadioButton2.Checked = True Then
sonuc = TextBox1.Text * TextBox2.Text
MsgBox("Diktörtgenin Alan = " & sonuc)
End If
If RadioButton3.Checked = True Then
sonuc = 3.14 * (TextBox3.Text ^ 2)
MsgBox("Dairenin Alan = " & sonuc)
End If
End Sub
End Class
Hiç yorum yok:
Yorum Gönder