我正在Visual Studio Community 2017中使用VB.NET。我注意到在某些情况下,对象的可用属性和方法列表不完整。
如图所示,我想使用RowCount
对象的dgv
属性,即System.Windows.Forms.DataGridView
类型。您可以看到,在该属性的上方,该属性就可以正常工作,我可以手动输入它。在后台编译器(由于缺乏更好的术语)确认它正确之前,只需要一两秒钟。该行为使键入流程变得混乱,因为IntelliSense通常会自动更正它认为是错别字的内容。
注意:这并不限于显示的属性。我在其他示例中以及在函数调用和其他随机位置中都注意到了这一点,但是我找不到丢失和不丢失的清晰方法。
环顾四周,我发现this question,但是它处理了一个完全不同的问题。
这只是Visual Studio中的错误(如果是,是否在某个地方报告了该错误?),有人可以确认这一点,并且有人知道此修复程序吗?
按照您的步骤,我得到的结果与您相同,我已经向VS产品小组报告了此问题,请检查:VS 2017--VB: the intellisense for the DataGridView control not works like VS 2015,您可以投票或添加评论,然后我们需要等待确认VS产品团队的来信,谢谢您的反馈。同时,我在C#> Windows Forms应用程序中进行了尝试,而Intellisense就像VS 2015一样运行良好。
[Albano Gheller在Visual Studio Community page上发布了答案。
引用他和修复所需的步骤:
I've fixed the problem in this way:
1. I've exported my settings from Tool - Import/Export settings
2. I've set the property HideAdvancedMembers = true inside
<ToolsOptionsSubCategory name="Basic" RegisteredName="Basic" PackageName="Text Management Package">
because C# has true and works
3. I've imported this modified settings.
所以总结一下:
查找部件:导出的设置文档的<PropertyValue name="HideAdvancedMembers">false</PropertyValue>
ToolsOptionsSubCategory中的Basic
。将其更改为<PropertyValue name="HideAdvancedMembers">true</PropertyValue>
,保存,然后重新导入设置。
我不知道为什么隐藏成员会导致显示更多成员,但无论如何;-)
为Jens回答的补充/为其他人节省一些工作:
<UserSettings>
<ApplicationIdentity version="15.0"/>
<ToolsOptions>
<ToolsOptionsCategory RegisteredName="TextEditor" name="TextEditor">
<ToolsOptionsSubCategory PackageName="Text Management Package" RegisteredName="Basic" name="Basic">
<PropertyValue name="HideAdvancedMembers">true</PropertyValue>
</ToolsOptionsSubCategory>
</ToolsOptionsCategory>
</ToolsOptions>
</UserSettings>
a.vssettings
文件中>我假设VS中存在一个错误,他们将智能逻辑的布尔逻辑倒置了,当此属性为false时隐藏高级成员,而在为true时显示高级成员