1.计算总价代码怎么写?单价,数量和总价统属 进货单表,当输入单价和数量时无需输入总价textbox便能自动计算并显示。。我参考了书上写的代码,当时输入无任何反应。
/单价离开焦点时计算金额
Private Sub price_lostfocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles allcount.LostFocus
If IsNumeric(price.Text) Then
Try
price.Text = Format(CDbl("0" & price.Text), "#,###,##0.00")
Catch ex As Exception
End Try
End If
End Sub
/数量离开焦点时计算金额
Private Sub allcount_lostfocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles allcount.LostFocus
If IsNumeric(allcount.Text) Then
Try
allcount.Text = Format(CDbl("0" & allcount.Text), "#,###,##0.00")
Catch ex As Exception
End Try
End If
End Sub