This Visual Basic code defines event handler subroutines for when the "Area_Click" and "Volumen_Click" buttons are clicked. When "Area_Click" is clicked, it calculates the area and volume of a circle using the radius entered in the "radio" text box, checking that the input is a valid number greater than 0 first. It displays the results in labels. When "Volumen_Click" is clicked, it hides the current form and shows another form.
This Visual Basic code defines event handler subroutines for when the "Area_Click" and "Volumen_Click" buttons are clicked. When "Area_Click" is clicked, it calculates the area and volume of a circle using the radius entered in the "radio" text box, checking that the input is a valid number greater than 0 first. It displays the results in labels. When "Volumen_Click" is clicked, it hides the current form and shows another form.
This Visual Basic code defines event handler subroutines for when the "Area_Click" and "Volumen_Click" buttons are clicked. When "Area_Click" is clicked, it calculates the area and volume of a circle using the radius entered in the "radio" text box, checking that the input is a valid number greater than 0 first. It displays the results in labels. When "Volumen_Click" is clicked, it hides the current form and shows another form.
Dim r As Single, A As Single If Not IsNumeric(radio.Text) Then MsgBox "DATO NO VALIDO" Else If (radio.Text <= 0) Then MsgBox "DATO NO VALIDO" Else r = radio.Text A = 4 * 3.14 * Val(r) ^ 2 v = 4 / 3 * 3.14 * Val(r) ^ 3 respuesta.Caption = "El area es " & A & " y el volumen es " & v End If End If End Sub Private Sub Volumen_Click() Guia_3_1.Hide Guia_3.Show End Sub