简体   繁体   中英

What happened to Intellisense for enum types in Visual Studio 2010 using VB.NET?

I am using Visual Studio 2010 Prof.

In C# I can create my own Enumerator and use it like this:

MyEnum value = 

Now, Intellisense will suggest a value of MyEnum.

In VB, when I write:

Dim value As MyEnum = 

I get a huge list of every types. When starting to write my enumerator value (could be a word like "sunny") it filters out some types but I would like to have it like in C#. Anyway I will use the MyEnum type and no "String nor Objecte nor IntPtr...".

Any idea?

Screenshot

Also I made a short video: Video with sample (new)

Regards

Simple, all you have to do is click the "Common" tab at the bottom of the Intellisense drop-down.
To prove it, here's a screenshot of what I see in VS 2010, immediately after typing = :

But, even if you have the "All" tab selected, the values defined in the enum will still be automatically displayed first, and even appear grouped together. You will indeed see all possible members and types, even those that are completely unrelated, but it's still pretty easy to find the ones you want.

And no, I'm not using any third-party add-ins or extensions to achieve the demonstrated feat. As best I can tell, I also haven't reconfigured any relevant options from the default settings.

This is a documented issue in VS 2010, pre-SP1. See: https://connect.microsoft.com/VisualStudio/feedback/details/551699/intellisense-enum-values . It has been fixed in SP1. If you can't install SP1, the only workaround is to use the mouse or Alt + , to switch from the "All" to the "Common" tab.

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