As shown in the figure, after I declare a property or function and save it, Visual Studio will automatically indent my code, causing the declaration to misalign with the macro. Is there any way to turn off the automatic indentation?
1 Like
Hi YueZhengRedMoon,
You can turn off the Visual Studio auto-formatting from the Tools->Options menu.
In the TextEditor section there are options for each language type:
2 Likes
Hi RecourseDesign,
Thanks for your reply. I have set it according to your image, but it still doesn’t work.
Did you turn off the indentation in the c# section as well?
I tried to change the indentation Settings for C#, but it still didn’t work. Maybe this is because of the version of Visual Studio? My Version of Visual Studio is 2022 and I didn’t have this problem with Visual Studio 2019. I’ve asked a lot of people and they don’t know the solution, so maybe I should try to get used to the indentation. Anyway, thanks for your help!
1 Like