welcome all,
I am just starting learning vb.net version 2008
I am trying this code to do program to calculate the area of shapes
an error occur when starting program.the error is (Conversion from string "" to type 'Double' is not valid.)
this is code which i used it
pleas help me
I am just starting learning vb.net version 2008
I am trying this code to do program to calculate the area of shapes
an error occur when starting program.the error is (Conversion from string "" to type 'Double' is not valid.)
this is code which i used it
PHP Code:
Public Class Form1
Dim area As Double
Dim Diameter As Double
Dim length As Double
Dim wide As Double
Dim height As Double
Dim base As Double
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
TextBox1.Visible = True
TextBox2.Visible = False
TextBox3.Visible = False
TextBox4.Visible = False
TextBox5.Visible = False
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
TextBox1.Visible = False
TextBox2.Visible = True
TextBox3.Visible = True
TextBox4.Visible = False
TextBox5.Visible = False
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
TextBox1.Visible = False
TextBox2.Visible = False
TextBox3.Visible = False
TextBox4.Visible = True
TextBox5.Visible = True
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Diameter = TextBox1.Text
length = TextBox2.Text
wide = TextBox3.Text
height = TextBox4.Text
wide = TextBox5.Text
If RadioButton1.Checked = True Then
area = (Diameter ^ 2) * 3.14 / 4
ElseIf RadioButton2.Checked = True Then
area = length * wide
ElseIf RadioButton3.Checked = True Then
area = height * base * 0.5
End If
Label6.Text = CStr(area)
End Sub
End Class