Vb.net VB MsgBox vbYesNo未声明
我有一个程序的简单部分,它会出现错误:VB MsgBox YESNON未声明 如果有必要,我会使用Visual Studio Express 2012和Windows 7 未声明VbYesNo。由于其保护级别,可能无法访问 非常感谢过去没有发生过的麻烦 哪个程序出现故障:Vb.net VB MsgBox vbYesNo未声明,vb.net,Vb.net,我有一个程序的简单部分,它会出现错误:VB MsgBox YESNON未声明 如果有必要,我会使用Visual Studio Express 2012和Windows 7 未声明VbYesNo。由于其保护级别,可能无法访问 非常感谢过去没有发生过的麻烦 哪个程序出现故障: userchoice = MsgBox("Did you mean to enter A?", vbYesNno, "Yes") ' if yes add, if no subtract 所有程序: Public Class
userchoice = MsgBox("Did you mean to enter A?", vbYesNno, "Yes") ' if yes add, if no subtract
所有程序:
Public Class MainForm
Public stroperation, strnumber1, strnumber2, strresult As String
Public decnumber1, decnumber2, decresult As Decimal
Public operation, userchoice
Private Sub calculateButton_Click(sender As Object, e As EventArgs) Handles calculateButton.Click
operation = operationTextBox.Text
stroperation = CStr(operation)
strnumber1 = number1TextBox.Text
decnumber1 = CDec(strnumber1)
strnumber2 = number2TextBox.Text
decnumber2 = CDec(strnumber2)
If stroperation = "S" Or stroperation = "s" Then
decresult = decnumber1 - decnumber2
strresult = CStr(decresult)
resultLabel.Text = "Difference: " & strresult
ElseIf stroperation = "A" Or stroperation = "a" Then
decresult = decnumber1 + decnumber2
strresult = CStr(decresult)
resultLabel.Text = "Sum: " & strresult
Else
userchoice = MsgBox("Did you mean to enter A?", vbYesNno, "Yes") ' if yes add, if no subtract
If userchoice = vbYes Then
decresult = decnumber1 + decnumber2
strresult = CStr(decresult)
resultLabel.Text = "Sum: " & strresult
ElseIf userchoice = vbNo Then
decresult = decnumber1 - decnumber2
strresult = CStr(decresult)
resultLabel.Text = "Difference: " & strresult
End If
End If
End Sub
Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class
您有一个输入错误:
userchoice = MsgBox("Did you mean to enter A?", vbYesNno, "Yes")
注意“Nn”。它应该是vbYesNo
您有一个输入错误:
userchoice = MsgBox("Did you mean to enter A?", vbYesNno, "Yes")
If MsgBox("Are You Sure ?", vbYesNo, "Yes") = MsgBoxResult.Yes Then
MsgBox("Yes")
Else
MsgBox("No")
End If
注意“Nn”。它应该是vbYesNo
您有一个输入错误:
userchoice = MsgBox("Did you mean to enter A?", vbYesNno, "Yes")
If MsgBox("Are You Sure ?", vbYesNo, "Yes") = MsgBoxResult.Yes Then
MsgBox("Yes")
Else
MsgBox("No")
End If
注意“Nn”。它应该是vbYesNo
您有一个输入错误:
userchoice = MsgBox("Did you mean to enter A?", vbYesNno, "Yes")
If MsgBox("Are You Sure ?", vbYesNo, "Yes") = MsgBoxResult.Yes Then
MsgBox("Yes")
Else
MsgBox("No")
End If
注意“Nn”。它应该是vbYesNo
If MsgBox("Are You Sure ?", vbYesNo, "Yes") = MsgBoxResult.Yes Then
MsgBox("Yes")
Else
MsgBox("No")
End If