Formatting Source Code (IDE Tutorial)
Go Up to The Code Editor Index (IDE Tutorial)
For consistency and clarity, you can format source code in the Code Editor. You can set formatting options for indentation, spaces, line breaks, alignment and capitalization.
You can format source in a couple of ways: as you write code, or as you format a selection of code or the entire file using Code Editor context menus. You can also format a project's files.
The Options dialog (displayed by Tools > Options) allows you to both enable formatting and set the options for how formatting is done. C++ and Delphi each have their own formatting options. You can also create and restore profiles for different formatting styles.
See Formatting Source Code for more details on source formatting.