Kod:
Private Sub Command1_Click()
Dim a, b, c As Double
If Option1.Value = True Then
a = Val(Text1.Text)
b = 3.14 * a ^ 2
Text3.Text = b
End If
If Option2.Value = True Then
a = Val(Text1.Text)
b = a ^ 2
Text3.Text = b
End If
If Option3.Value = True Then
a = Val(Text1.Text)
b = Val(Text2.Text)
c = a * b
Text3.Text = c
End If
If Option4.Value = True Then
a = Val(Text1.Text)
b = Val(Text2.Text)
c = (a * b) / 2
Text3.Text = c
End If
End Sub
Private Sub option1_click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label2.Visible = False
Text2.Visible = False
Label1.Caption = "yarıçap(r)"
Label3.Caption = "Alan"
End Sub
Private Sub option2_click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label2.Visible = False
Text2.Visible = False
Label1.Caption = "Kenar(a)"
Label3.Caption = "Alan"
End Sub
Private Sub option3_click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label2.Visible = True
Text2.Visible = True
Label1.Caption = "Kenar(a)"
Label2.Caption = "Kenar(b)"
Label3.Caption = "Alan"
End Sub
Private Sub option4_click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label2.Visible = True
Text2.Visible = True
Label1.Caption = "Taban(a)"
Label2.Caption = "Yükseklik(h)"
Label3.Caption = "Alan"
End Sub