![](/img/trans.png)
[英]error BC30456: 'VisualBasic' is not a member of 'Microsoft'
[英]bc30456 errors… xxxx not a member of yyyy
嗨,我刚刚开始学习VB,就像在VS 2015中一样。我正在从Bryon Newsome撰写的《 Beginning Visual Basic 2015》一书中进行练习。 我无法从发布者论坛或发布者本身获得任何帮助。 我在较早的练习中设法解决了此类错误,但是以下内容无法解决。
以下是第214页至第215页的代码:
Public Class Form1
Private Sub btn2Buttons_Click(sender As Object,
e As EventArgs) Handles btn2Buttons.Click
If MessageBox.Show("Your Internet connection will now be closed.",
"Network Notification", MessageBoxButtons.OKCancel,
MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) _
= Windows.Forms.DialogResult.OK Then
lblResults.Text = "OK Clicked"
'Call some method here
Else
lblResults.Text = "Cancel Clicked"
'Call some method here
End If
End Sub
End Class
以下是来自两个错误消息:
Severity Code Description Project File Line
Error BC30456 'OKCancel' is not a member of 'MessageBoxButtons'. MessageBoxButtons E:\Document\Programing\VB\MessageBoxButtons\MessageBoxButtons\Form1.vb 5
Severity Code Description Project File Line
Error BC30456 'Forms' is not a member of 'Windows'. MessageBoxButtons E:\Document\Programing\VB\MessageBoxButtons\MessageBoxButtons\Form1.vb 7
标签只有一个:lblResults带有文本属性
有一个按钮:具有文本属性2 Buttons的btn2buttons。
If MessageBox.Show("Your Internet connection will now be closed.",
"Network Notification", System.Windows.Forms.MessageBoxButtons.OKCancel,
System.Windows.Forms.MessageBoxIcon.Information, System.Windows.Forms.MessageBoxDefaultButton.Button1) = Windows.Forms.DialogResult.OK Then
lblResults.Text = "OK Clicked"
'Call some method here
Else
lblResults.Text = "Cancel Clicked"
'Call some method here
End If
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.