Microsoft Visual Studio – The default format code hot keys for Visual Studio – VB.Net

Let’s say you copied/pasted many lines of code to create a new function, and then gutted out 50% of the code. Sometimes the code does not reformat nicely. To manually reformat the code in VB.Net, Hold down the CTRL key and then press the K key, immediately followed by the D key.

If you only want to format a portion of the code, first select (highlight) the code. Hold down the CTRL key and then press the K key, immediately followed by the F key.

Format complete.