I have 4 textboxes, 2 that you can write to and 2 you can't. The totalbox is a readonly and uses the data from the shipprcbox, taxbox, and subtotalbox to make its calculations. I'm currently using a click event initilize the money sub which works but i would like to be able to have the data just update right when it's entered and i can't seem to figure out why its not working (i have set the textboxes with autopostback="true").
Public Sub money() If IsNumeric(taxbox.Text) = True Then taxbox.BackColor = Drawing.Color.White POl.Tax = Convert.ToDecimal(taxbox.Text) Else taxbox.Text = "0.00" POl.Tax = 0.0 taxbox.BackColor = Drawing.Color.Red End If If IsNumeric(shipprcbox.Text) = True Then shipprcbox.BackColor = Drawing.Color.White POl.Shipping = Convert.ToDecimal(shipprcbox.Text) Else shipprcbox.Text = "0.00" POl.Shipping = 0.0 shipprcbox.BackColor = Drawing.Color.Red End If subtotalbox.Text = String.Format("{0:F2}", POl.SubTotal) fintotalbox.Text = String.Format("{0:F2}", POl.Total) taxbox.Text = String.Format("{0:F2}", POl.Tax) shipprcbox.Text = String.Format("{0:F2}", POl.Shipping) end sub
Read Full article Here.
No comments:
Post a Comment
Post your comments here: