简体   繁体   中英

Visual Studio 2015 (VB.NET) IntelliSense not showing variables, methods and properties

Up to now IntelliSense listed all public variables, methods and properties of a class, when I used the name somewhere else, but now it only shows a few properties and methods. The problem also occurs with forms and other controls.

There is a post, which dealed already with this issue ( link to the post ), but it does not provide a working solution. Maybe someone knows the reason for this behaviour.

Edit: Here is a screenshot with an example:

屏幕截图

From your screenshot the problem is easier to spot. You are using the Default Instance of a form. As Hans said, intellisense not displaying here is a probably a minor bug that Microsoft will likely not fix. Your code is easier to fix however. Don't use the default instance; it should look like this:

dim f as new Form1
f.Sub1 '<--- should get intellisense here now.

You should avoid using default instance of forms. In my experience, they cause nothing but problems. Creating a form instance, storing it in a local variable or field, and passing those references around is easy enough. It's also a much better practice that will make your code stronger overall.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM