【发布时间】:2018-07-09 21:43:16
【问题描述】:
我已经使用 vb.net 很长时间了,但从来没有遇到过这个问题。由于某种原因,Intellisense 没有检测到 MsgBox()。当我将鼠标悬停在突出显示的红线上时,它显示“'MsgBox' 未声明。由于其保护级别,它可能无法访问”,并且在潜在的修复中,它尝试创建一个名为 MsgBox() 的新函数。 下面是代码:
Imports System
Imports System.Data.SqlClient
Imports System.Runtime.InteropServices
Imports System.Web.Configuration
Imports Microsoft.Office.Interop.Outlook
Public Class ConferenceRooms
Inherits System.Web.UI.Page
Dim SQLConnection As New
SqlConnection(ConfigurationManager.ConnectionStrings("MyDB").ConnectionString)
Dim SQLcommand As New SqlCommand
Dim SQLAdapter As SqlDataAdapter
Dim SQLDataTable As DataTable
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'MsgBox(LBTest.Attributes("title"))
'Dim lb As Label = CType(Me.Controls("HR Conference Room"), Label)
If Not IsPostBack Then
Dim Query1 As String
Query1 = "Select Location_ID from LCSConference_Locations where vacant = 1"
RunQuery(Query1)
Dim OrganizerEmail As String = OrgEmail.Value
Dim Agenda As String = MeetAgenda.Value
Dim Location As String = MeetLocation.Value
MsgBox("Hello")
End If
End Sub
【问题讨论】:
-
您在编译代码时是否收到任何问题?智能感知并不完美。尝试重新启动 IDE 以查看问题是否仍然存在。
-
是的,我也试过了。
-
谢谢,成功了。我猜它没有包含在项目中,因为它没有在属性窗口中标记。
标签: .net vb.net intellisense msgbox