i have it all coded but im getting a error with these lines
it says Conversion from string "" to type 'Double' is not valid.
Private Sub btnAddBookToCart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddBookToCart.Click
Dim objMainForm As New MainForm
If lbPrintBooks.SelectedIndex <> -1 Then
MainForm.lbBooks.Items.Add(lbPrintBooks.SelectedItem.ToString())
this line error gives me Conversion from string "" to type 'Double' is not valid.
MainForm.lblSubtotal.Text = (CDbl(MainForm.lblSubtotal.Text) + objMainForm.BookCost(lbPrintBooks.SelectedIndex)).ToString()
MainForm.lblTax.Text = ((CDbl(MainForm.lblSubtotal.Text)) * 6 / 100).ToString()
MainForm.lblShipping.Text = ((MainForm.lbBooks.Items.Count) * 2).ToString()
MainForm.lblTotal.Text = (CDbl(MainForm.lblSubtotal.Text) + CDbl(MainForm.lblTax.Text) + CDbl(MainForm.lblShipping.Text)).ToString()
End If
End Sub
it says Conversion from string "" to type 'Double' is not valid.
Private Sub btnAddBookToCart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddBookToCart.Click
Dim objMainForm As New MainForm
If lbPrintBooks.SelectedIndex <> -1 Then
MainForm.lbBooks.Items.Add(lbPrintBooks.SelectedItem.ToString())
this line error gives me Conversion from string "" to type 'Double' is not valid.
MainForm.lblSubtotal.Text = (CDbl(MainForm.lblSubtotal.Text) + objMainForm.BookCost(lbPrintBooks.SelectedIndex)).ToString()
MainForm.lblTax.Text = ((CDbl(MainForm.lblSubtotal.Text)) * 6 / 100).ToString()
MainForm.lblShipping.Text = ((MainForm.lbBooks.Items.Count) * 2).ToString()
MainForm.lblTotal.Text = (CDbl(MainForm.lblSubtotal.Text) + CDbl(MainForm.lblTax.Text) + CDbl(MainForm.lblShipping.Text)).ToString()
End If
End Sub