Search code examples
c#.netvisual-studio-2005intellisense

Can I order the enum values in intellisense?


I have an eum type with 5 members. Is it possible to tell intellisense to order them the way I want?

public enum numbers
{
    zero,
    one,
    two,
    three,
    four
}

Intelisense shows (in alpha):

four
one
three
two
zero

Solution

  • No you cant. But the Visual Studio team has considered the suggestion even though not exactly the way you would want it. But hey, its a start.

    You can vote on the link @sepster provided:

    https://developercommunity2.visualstudio.com/t/Intellisense-display-enums-by-numeric-or/871057?space=8&entry=suggestion


    Edit: Microsoft connect has been retired. Leaving this here for future reference.

    See the Microsoft connect response here http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=419602

    I have added your requirement as a comment on the site.