我需要计算另一个表单ListBox
中所有值的折扣金额,然后在折扣表单和主表单中打印该值。
折扣表格代码:
Private Sub btnCalculateVisit_Click(sender As Object, e As EventArgs) Handles btnCalculateVisit.Click
Dim dblVisits As Double = 0
If (IsNumeric(txtVisits.Text)) Then
If txtVisits.Text >= 0 And txtVisits.Text <= 3 Then
dblVisits = (dblVisitRates(0) * GlobalVariables.price)
ElseIf txtVisits.Text >= 4 And txtVisits.Text <= 8 Then
dblVisits = (dblVisitRates(1) * GlobalVariables.price)
ElseIf txtVisits.Text >= 9 And txtVisits.Text <= 13 Then
dblVisits = (dblVisitRates(2) * GlobalVariables.price)
ElseIf txtVisits.Text >= 14 And txtVisits.Text <= 1000000 Then
dblVisits = (dblVisitRates(3) * GlobalVariables.price)
End If
End If
lblDiscountAmount.Text = "$" + dblVisits.ToString
End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
Dim main As New MainForm()
main.lblDisRate.Text = GlobalVariables.dblType.ToString
Me.Close()
End Sub
计算打印在折扣表单上,但不会更改主表单中的标签。我该怎么做?
答案 0 :(得分:0)
使用caption属性尝试并对表单进行刷新。
?[`table;enlist (=;enlist `giving_type;`type);0b;()]