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

瘦欲@ 提交于 2020-01-30 06:34:06

问题


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:


回答1:


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.



来源:https://stackoverflow.com/questions/35134781/visual-studio-2015-vb-net-intellisense-not-showing-variables-methods-and-prop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!