Private Sub txtamount_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtamount.TextChanged
    If String.IsNullOrEmpty(txtquantity.Text) OrElse String.IsNullOrEmpty(txtamount.Text) Then Exit Sub
    If Not IsNumeric(txtquantity.Text) OrElse Not IsNumeric(txtamount.Text) Then Exit Sub
    txttotal.Text = CDbl(txtquantity.Text) * CDbl(txtamount.Text)
End Sub


Private Sub txtquantity_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtquantity.TextChanged
    If String.IsNullOrEmpty(txtquantity.Text) OrElse String.IsNullOrEmpty(txtamount.Text) Then Exit Sub
    If Not IsNumeric(txtquantity.Text) OrElse Not IsNumeric(txtamount.Text) Then Exit Sub
    txttotal.Text = CDbl(txtquantity.Text) * CDbl(txtamount.Text)
End Sub

Private Sub txttotal_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txttotal.TextChanged
    If Len(Trim(txtquantity.Text)) = 0 And Len(Trim(txtamount.Text)) = 0 Then
        txttotal.Text = ""
    End If
End Sub

Here's my code, the amount and quantity works fine. But everytime I delete the value of quantity and amount in textbox , the total still display the previous answer...

You haven't set txttotal.Text = "" or txttotal.Text = Nothingin "txtamount_TextChanged" or "txtquantity_TextChanged" if txtamount or txtquantity is null or empty.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.