Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. Prevent VS from changing code style?

Prevent VS from changing code style?

Scheduled Pinned Locked Moved Visual Studio
visual-studioquestioncsharptutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zequion
    wrote on last edited by
    #1

    Question 1: It seems silly, but I have the need to put the lines of the code together to see everything faster. VS reformats the appearance, so I have to remove their corrections from time to time. How do you prevent VS from reforming the appearance of the code? Example.I have this code: If (A == 1) {   B = 2;     C = 3; } And Visual Studio fits it to: If (A == 1) {     B = 2;     C = 3; } The same thing happens with spaces. For example I want everything together as if(A==1)... Question 2: On the other hand, sometimes I have a code paragraph with the keys and text in the wrong place and I want VS to reformat it all together (not line by line). Example: If (A == 1)            {      B = 2;           C = 2; } Notes: You could do a section only with the faults and improvements that I find in VS. Today's example: It does sometimes, but not always, I get errors when compiling, I correct them and they continue to appear as if I had not changed it. Although compile again, it still does. It is only solved if I close and open the solution. Thanks.

    L 1 Reply Last reply
    0
    • Z zequion

      Question 1: It seems silly, but I have the need to put the lines of the code together to see everything faster. VS reformats the appearance, so I have to remove their corrections from time to time. How do you prevent VS from reforming the appearance of the code? Example.I have this code: If (A == 1) {   B = 2;     C = 3; } And Visual Studio fits it to: If (A == 1) {     B = 2;     C = 3; } The same thing happens with spaces. For example I want everything together as if(A==1)... Question 2: On the other hand, sometimes I have a code paragraph with the keys and text in the wrong place and I want VS to reformat it all together (not line by line). Example: If (A == 1)            {      B = 2;           C = 2; } Notes: You could do a section only with the faults and improvements that I find in VS. Today's example: It does sometimes, but not always, I get errors when compiling, I correct them and they continue to appear as if I had not changed it. Although compile again, it still does. It is only solved if I close and open the solution. Thanks.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Go to Tools -> Options, and change the code editor formats.

      Z 1 Reply Last reply
      0
      • L Lost User

        Go to Tools -> Options, and change the code editor formats.

        Z Offline
        Z Offline
        zequion
        wrote on last edited by
        #3

        I am a very simple person and I do not understand the brief and enigmatic answers. I also have not found that option that indicates.

        L 1 Reply Last reply
        0
        • Z zequion

          I am a very simple person and I do not understand the brief and enigmatic answers. I also have not found that option that indicates.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Using the Visual Studio menu, select Tools, then Options. Then find the Text Editor section, select the language you are interested in and see what options there are. Try and make an effort to learn the features of the system that you are using.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups