0

所以我只是在做一个小应用程序,我在这里有一个子句说

If hoursPerPeriod > 0 And salary > 0 Then
        If numberPayPeriods = 0 Then
            MessageBox.Show("Please enter number of pay periods!")
        End If
        txtCalculatedPaycheckGross.Text = salary / numberPayPeriods
    End If

因此,如果用户输入他们的薪水信息并填写他们的小时和薪水,程序将只计算他们的薪水。但如果支付周期数框为 0,则在修复之前不会计算任何内容。问题是,在显示要求他们输入值的消息框后,如何阻止代码继续执行?

4

1 回答 1

3
If hoursPerPeriod > 0 And salary > 0 Then
        If numberPayPeriods = 0 Then
            MessageBox.Show("Please enter number of pay periods!")
        else
            txtCalculatedPaycheckGross.Text = salary / numberPayPeriods
        end if
    End If
于 2013-10-13T20:50:55.383 回答