我想出了如何清除文本框,但是当我在MessageBox上按否时清除了该文本框。我想清除用户是否选择是。如果用户选择否那么我想什么都不做。使用MessageBox清除文本框是按钮
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
你有downvote前检查? – Kasnady 2013-03-20 04:24:09
你可以考虑添加一个关于OP在做什么错误的评论,你的代码是干什么的,等等。 – Jeff 2013-03-20 04:26:15
我只是回答了问题 – Kasnady 2013-03-20 04:28:34