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.

53 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Torbjörn GörtzTorbjörn Görtz shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    6 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Torbjörn GörtzTorbjö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.

      • SimonSimon 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örtzTorbjö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 PinkhamJeff 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örtzTorbjö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örtzTorbjö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