how to fix from this code?
Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click Dim a As Double = 0 Dim j As Integer = poly.n - 1 Dim i As Integer
For i = 0 To poly.n Step 1
a = a +((poly.Elmt(j).x + poly.Elmt(i).x) * (poly.Elmt(j).y - poly.Elmt(i).y))
j = i
Next
a = Math.Abs(a / 2)
MessageBox.Show("Area of The Polygon: " & a & " ")
End Sub