none
How to indent my vb.net code RRS feed

  • Question

  • I remember in vb.net 2010 there use to be a tool in the menu that allowed you to select a range of code and have them all indented properly?? No matter where I look I can not find it. As I code in Vb.net 2015 depending on what I do some of the lines are indented and some are not. To do them one at a time is painful and it appears if I adjust one line several self adjust???

    Can someone provide me help here?

    Thanks

    Les

    Thursday, September 20, 2018 3:13 AM

Answers

  • At least for VS2015/VS2017 there are shortcut keys for formatting.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by Les2011 Saturday, September 22, 2018 4:50 PM
    Thursday, September 20, 2018 9:43 AM
    Moderator
  • Hi Karen,

    Just saw your post.  I did look under ADVANCED and see they have a increase line indent which is what I am looking for however I seem to remember that there was a tool icon that looked similar to it on my menu strip.  Any idea how to put them onto my menu?

    Thanks,

    Les

    I think you mean the Html indents? Click the right mouse button on the toolbar and select HTML source toolbar. Then select the dropdown list on the toolbar to choose buttons. You will have to turn off the automatic indent?

    Or its maybe some other toolbar like format you are recalling?

    • Marked as answer by Les2011 Saturday, September 22, 2018 4:50 PM
    Saturday, September 22, 2018 2:56 PM

All replies

  • Hi,

    Is this a tool?

    1. Enter Tool - Options Dialog

    2. Select [Environment] - [Keyboard]

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, September 20, 2018 5:21 AM
  • Hi Alex,

    I will try your suggestion tomorrow.  I seemed to remember there being a button icon that allowed you to shift the highlighted texted left or right??  The icon looked like just left justified lines or right justified lines that allowed you to push the selected text either right or left.  I will check it out.

    Thanks

    Les

    Thursday, September 20, 2018 6:33 AM
  • At least for VS2015/VS2017 there are shortcut keys for formatting.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by Les2011 Saturday, September 22, 2018 4:50 PM
    Thursday, September 20, 2018 9:43 AM
    Moderator
  • Hi Karen,

    Just saw your post.  I did look under ADVANCED and see they have a increase line indent which is what I am looking for however I seem to remember that there was a tool icon that looked similar to it on my menu strip.  Any idea how to put them onto my menu?

    Thanks,

    Les

    Saturday, September 22, 2018 5:55 AM
  • Hi Karen,

    Just saw your post.  I did look under ADVANCED and see they have a increase line indent which is what I am looking for however I seem to remember that there was a tool icon that looked similar to it on my menu strip.  Any idea how to put them onto my menu?

    Thanks,

    Les

    I think you mean the Html indents? Click the right mouse button on the toolbar and select HTML source toolbar. Then select the dropdown list on the toolbar to choose buttons. You will have to turn off the automatic indent?

    Or its maybe some other toolbar like format you are recalling?

    • Marked as answer by Les2011 Saturday, September 22, 2018 4:50 PM
    Saturday, September 22, 2018 2:56 PM
  • Hi Karen,

    Just saw your post.  I did look under ADVANCED and see they have a increase line indent which is what I am looking for however I seem to remember that there was a tool icon that looked similar to it on my menu strip.  Any idea how to put them onto my menu?

    Thanks,

    Les

    Yes it was on the toolbar before but here is how they look at functionality, if the Visual Studio team believes a function will be used often they will place it on the toolbar.

    Also consider straight out of the box Visual Studio auto-formats code so the majority of VB.NET developers  don't use this. Personally I prefer Resharper's (the absolute best add-in but is a paid for add-in) formatting.

    If you believe this is something you always want visible then go with Tommy's reply.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Saturday, September 22, 2018 3:04 PM
    Moderator
  • Ok Karen thx for this info, makes sense.  I will have to take a look at the Resharper tool you mentioned.

    Thx

    Les

    Saturday, September 22, 2018 4:47 PM
  • Reshaper does a lot more than formatting, do check it out. I use it at home and work.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Saturday, September 22, 2018 5:33 PM
    Moderator