How to automatically re-format C# code

After years of working with Visual Basic, I became quite fond of the fact that the code was automatically reformatted when the return key is pressed. Now that I am learning C#, I have found that CTRL-KD re-formats the code but I do not see how to set it so that it is done automatically when return is pressed.

If you know how to do that please reply.

If you use Visual Studio you get do this with the preferences settings:

Preferences → TextEditor → Behaviour
and
Preferences → TextEditor → Behaviour → C#

This does vary slightly from Visual Studio versions though.

I went to Options-Text Editor-C#-Formatting and checked all the boxes… no help.

No idea :confused: