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. The Lounge
  3. Visual Studio 2005 Text Editor Question

Visual Studio 2005 Text Editor Question

Scheduled Pinned Locked Moved The Lounge
csharpquestionvisual-studiocomtutorial
9 Posts 6 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.
  • M Offline
    M Offline
    Mike Puddephat
    wrote on last edited by
    #1

    Hi and apologies if this is the wrong forum for such a post. I have a quick question regarding C# code formatting in Visual Studio 2005... I kind of like most of the smart text editor features in VS2005 (for example, the way code is re-indented when the C# closing brace is pressed). However, what I don't like is the way that this smart re-formatting trashes all my vertical column alignments like this... I like to write code like this...

    private CheckBox _notifyCheckBox;
    private TextBox _subjectTextBox;
    private TextBox _bodyTextBox;
    private ValidationSummary _validationSummary;

    VS2005 reformats the above code like this...

    private CheckBox _notifyCheckBox;
    private TextBox _subjectTextBox;
    private TextBox _bodyTextBox;
    private ValidationSummary _validationSummary;

    Is it possible to keep the smart text editor features, without the above happening? Thanks! Visit Riverside Internet[^] Visit Mike Puddephat Online[^]

    W V C M 4 Replies Last reply
    0
    • M Mike Puddephat

      Hi and apologies if this is the wrong forum for such a post. I have a quick question regarding C# code formatting in Visual Studio 2005... I kind of like most of the smart text editor features in VS2005 (for example, the way code is re-indented when the C# closing brace is pressed). However, what I don't like is the way that this smart re-formatting trashes all my vertical column alignments like this... I like to write code like this...

      private CheckBox _notifyCheckBox;
      private TextBox _subjectTextBox;
      private TextBox _bodyTextBox;
      private ValidationSummary _validationSummary;

      VS2005 reformats the above code like this...

      private CheckBox _notifyCheckBox;
      private TextBox _subjectTextBox;
      private TextBox _bodyTextBox;
      private ValidationSummary _validationSummary;

      Is it possible to keep the smart text editor features, without the above happening? Thanks! Visit Riverside Internet[^] Visit Mike Puddephat Online[^]

      W Offline
      W Offline
      wout de zeeuw
      wrote on last edited by
      #2

      Whenever VS reformats you can press ^Z (undo) once and it only undoes the reformatting. Wout

      L M 2 Replies Last reply
      0
      • W wout de zeeuw

        Whenever VS reformats you can press ^Z (undo) once and it only undoes the reformatting. Wout

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        wout de zeeuw wrote:

        Whenever VS reformats you can press ^Z (undo) once and it only undoes the reformatting.

        You should bind that to every keystroke then :)

        xacc.ide-0.1.3.2

        1 Reply Last reply
        0
        • W wout de zeeuw

          Whenever VS reformats you can press ^Z (undo) once and it only undoes the reformatting. Wout

          M Offline
          M Offline
          Mike Puddephat
          wrote on last edited by
          #4

          Thanks. I already knew this, but I think it is quite annoying to keep pressing Ctrl+Z and sometimes I forget. Maybe leppie has the right idea! ;) Surely there is another way!? Visit Riverside Internet[^] Visit Mike Puddephat Online[^]

          1 Reply Last reply
          0
          • M Mike Puddephat

            Hi and apologies if this is the wrong forum for such a post. I have a quick question regarding C# code formatting in Visual Studio 2005... I kind of like most of the smart text editor features in VS2005 (for example, the way code is re-indented when the C# closing brace is pressed). However, what I don't like is the way that this smart re-formatting trashes all my vertical column alignments like this... I like to write code like this...

            private CheckBox _notifyCheckBox;
            private TextBox _subjectTextBox;
            private TextBox _bodyTextBox;
            private ValidationSummary _validationSummary;

            VS2005 reformats the above code like this...

            private CheckBox _notifyCheckBox;
            private TextBox _subjectTextBox;
            private TextBox _bodyTextBox;
            private ValidationSummary _validationSummary;

            Is it possible to keep the smart text editor features, without the above happening? Thanks! Visit Riverside Internet[^] Visit Mike Puddephat Online[^]

            V Offline
            V Offline
            Vikram A Punathambekar
            wrote on last edited by
            #5

            I use C# 2005 EE, but I imagine the steps you use with VS 2005 must be identical. Go to Tools - Options - Text editor - C# (or all languages, depending on your choice) - Formatting - General and uncheck Automatically format completed statement on ; However, it will have *other* impacts with code formatting - your tradeoff will be tough to call. HTH. :) Cheers, Vikram.


            I don't know and you don't either. Militant Agnostic

            M 1 Reply Last reply
            0
            • V Vikram A Punathambekar

              I use C# 2005 EE, but I imagine the steps you use with VS 2005 must be identical. Go to Tools - Options - Text editor - C# (or all languages, depending on your choice) - Formatting - General and uncheck Automatically format completed statement on ; However, it will have *other* impacts with code formatting - your tradeoff will be tough to call. HTH. :) Cheers, Vikram.


              I don't know and you don't either. Militant Agnostic

              M Offline
              M Offline
              Mike Puddephat
              wrote on last edited by
              #6

              Yes, unfortunately I do like the Automatically format completed statement on ; and on } options. So I don't really want to turn them off. I have just checked and this isn't a problem in VS2003. VS2003 preserves your spacing after a reformat. Visit Riverside Internet[^] Visit Mike Puddephat Online[^]

              1 Reply Last reply
              0
              • M Mike Puddephat

                Hi and apologies if this is the wrong forum for such a post. I have a quick question regarding C# code formatting in Visual Studio 2005... I kind of like most of the smart text editor features in VS2005 (for example, the way code is re-indented when the C# closing brace is pressed). However, what I don't like is the way that this smart re-formatting trashes all my vertical column alignments like this... I like to write code like this...

                private CheckBox _notifyCheckBox;
                private TextBox _subjectTextBox;
                private TextBox _bodyTextBox;
                private ValidationSummary _validationSummary;

                VS2005 reformats the above code like this...

                private CheckBox _notifyCheckBox;
                private TextBox _subjectTextBox;
                private TextBox _bodyTextBox;
                private ValidationSummary _validationSummary;

                Is it possible to keep the smart text editor features, without the above happening? Thanks! Visit Riverside Internet[^] Visit Mike Puddephat Online[^]

                C Offline
                C Offline
                code frog 0
                wrote on last edited by
                #7

                You can search for some free add-ins that will work with VS 2005 that have customized formatting. Then disable the VS 2005 and configure your own using the add-in. That's what I do. - Rex

                A Plain English signature. Code-frog System Architects, Inc.

                1 Reply Last reply
                0
                • M Mike Puddephat

                  Hi and apologies if this is the wrong forum for such a post. I have a quick question regarding C# code formatting in Visual Studio 2005... I kind of like most of the smart text editor features in VS2005 (for example, the way code is re-indented when the C# closing brace is pressed). However, what I don't like is the way that this smart re-formatting trashes all my vertical column alignments like this... I like to write code like this...

                  private CheckBox _notifyCheckBox;
                  private TextBox _subjectTextBox;
                  private TextBox _bodyTextBox;
                  private ValidationSummary _validationSummary;

                  VS2005 reformats the above code like this...

                  private CheckBox _notifyCheckBox;
                  private TextBox _subjectTextBox;
                  private TextBox _bodyTextBox;
                  private ValidationSummary _validationSummary;

                  Is it possible to keep the smart text editor features, without the above happening? Thanks! Visit Riverside Internet[^] Visit Mike Puddephat Online[^]

                  M Offline
                  M Offline
                  Michael Dunn
                  wrote on last edited by
                  #8

                  BTW we have a forum for VC IDE Issues, that would be the proper place to ask this question. (no harm done since it's already scrolled in the lounge, just letting you know for the future) --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

                  M 1 Reply Last reply
                  0
                  • M Michael Dunn

                    BTW we have a forum for VC IDE Issues, that would be the proper place to ask this question. (no harm done since it's already scrolled in the lounge, just letting you know for the future) --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

                    M Offline
                    M Offline
                    Mike Puddephat
                    wrote on last edited by
                    #9

                    Thanks, Mike. And apologies for using the wrong forum. I did check the Message Boards menu. But now I realise that the Visual Studio IDE forum is only visible from the Message Boards page! Visit Riverside Internet[^] Visit Mike Puddephat Online[^]

                    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