我想出了如何清除文本框,但是当我按下NoMessageBox 时它就会清除。我希望它清除用户是否选择Yes. 如果用户选择No,那么我什么也不想做。
Private Sub BtnFah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnFah.Click
Try
Dim intFah As Integer
intFah = CInt(TxtBoxTemp.Text)
intFah = (intFah * 9) / 5 - 32
If MessageBox.Show(intFah.ToString & ControlChars.CrLf & "Would you like to start another temp conversion?", "Result", MessageBoxButtons.YesNo) Then
TxtBoxTemp.Text = String.Empty
End If
Catch
MessageBox.Show("Would you like to start another temp conversion?", "System Error", MessageBoxButtons.YesNo)
End Try
End Sub