Every time I enter a number and this happened
"Input string was not in a correct format."
Also, Is there a way to make it so only numbers can be entered into a textbox.
"Input string was not in a correct format."
Code:
Private Sub InvoiceLabourCostBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InvoiceLabourCostBox.TextChanged
If InvoiceLabourCostBox.Text <> Nothing Then
Labourcost = Convert.ToDouble(InvoiceLabourCostBox.Text)
MaterialCost = Convert.ToDouble(InvoiceMaterialCostBox.Text)
TotalCost = (Labourcost + MaterialCost) * ((VATCost / 100) + 1)
TotalCostBox.Text = TotalCost
TotalCostBox.ReadOnly = True
End If
End Sub
Also, Is there a way to make it so only numbers can be entered into a textbox.