I suggest you ...

Double-click on a control ---> sub-procedure placed in alphabetical order (instead of at the end).

When I double-click on a control I want the sub-procedure (like "Private Sub Button2_Click...") to be placed in alphabetical order in the code module - instantly and automatic - like in VB6. (I cannot understand why this very basic function still is not available in the newest VB-version - at least as an option.) In large projects this is essential.

61 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Torbjörn Görtz shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

Thanks for taking the time to share this suggestion. This item has been around for a couple of versions of Visual Studio and we haven’t acted on it. Looking at the VS “15” plans, we’re not going to take action on this item, so we’re going to close it. If the suggestion is still relevant, please either take a look to see if there’s another suggestion that’s similar that you can vote on, or open a new suggestion.

- The Visual Studio Team

6 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Torbjörn Görtz commented  ·   ·  Flag as inappropriate

    If the sub-procedures is not in order ---> Check the beginning of the code module and place the new event procedure in alphabetic order in the part of the code which is in order now - and not pass the place in code where you start to code your own sub-procedures and functions. (Even better if you could place some comment '-------------- outside the event procedures to clearly signal to this function where this automatic positioning should end.)

    Of course this automatic placement in alphabetic order must be optional since it haven't existed for a long time.

    Please - Microsoft - to move first event procedure on each control by hand takes a lot of time. I could write my own program to do this - but then I have to save and exit the program each time I want to sort my code - so it should be done inside the IDE - just like in VB6.

  • Simon commented  ·   ·  Flag as inappropriate

    I'd suggest a modification - instead of inserting alphabetically (what does it do when your own code isn't alphabetical?). provide a refactoring action which sorts methods by name (or even better, type, name - ****, make it customisable) but explicitly DOESN'T reformat the methods themselves in any way. (Some of us like the default code formatting, some don't - don't force us to use it just to sort) This would allow an easy cleanup of any code files and solve your original problem with.

  • Torbjörn Görtz commented  ·   ·  Flag as inappropriate

    The nested dropdowns does only work after you have created the first event procedur on each control. If you create many new controls - which you normally do - you have to move your code after double click on your new control many times to be able to have them in alphabethical order.

    I only ask for an automatic correct placement of each new event procedur - just like in VB6.

  • Jeff Pinkham commented  ·   ·  Flag as inappropriate

    Yeah.. if this feature gets added it needs some sort of way of turning this off, as I separate my methods into certain areas, depending on the type of method. I use regions and separate them into events, methods and then sub region from that point. So something that automatically added it to the page alphabetically would be irritating if it couldn't be switched off.

    Also can't you just use the nested dropdowns at the top to find your method?

  • Torbjörn Görtz commented  ·   ·  Flag as inappropriate

    If you however create your own sub-procedure or function at the end of the module this should not be included in the alphabetic order. This also work very good in VB6.

  • Torbjörn Görtz commented  ·   ·  Flag as inappropriate

    This is the most important issue to make VB.NET work well. (There are several more issues that have to do with the visability and simplicity of working with code - but these are put in other suggestions.)

Feedback and Knowledge Base