编程中的循环结构与控件应用
1. 代码示例与功能分析
1.1 折扣计算代码
以下是一段用于计算折扣和新价格的代码:
Private Sub originalTextBox_TextChanged(
sender As Object, e As EventArgs
) Handles originalTextBox.TextChanged
' clear calculated amounts from labels
discountLabel.Text = String.Empty
newPriceLabel.Text = String.Empty
End Sub
Private Sub discountRateComboBox_TextChanged(
sender As Object, e As EventArgs
) Handles discountRateComboBox.TextChanged
' clear calculated amounts from labels
discountLabel.Text = String.Empty
newPriceLabel.Text = String.Empty
End Sub
Private Sub calcButton_Click(sender As Object,
e As EventArgs) Handles calcButton.Click
' calculate the discount and new price
Dim origlPrice As Decimal
Dim discR
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



