Visual Studio 2005 Text Editor Question
-
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[^]
-
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[^]
Whenever VS reformats you can press ^Z (undo) once and it only undoes the reformatting. Wout
-
Whenever VS reformats you can press ^Z (undo) once and it only undoes the reformatting. Wout
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 :)
-
Whenever VS reformats you can press ^Z (undo) once and it only undoes the reformatting. Wout
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[^]
-
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[^]
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
-
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
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[^] -
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[^]
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.
-
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[^]
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
-
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
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[^]