Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Setup / March 2005

Tip: Looking for answers? Try searching our database.

Can I Expand Tabs to Spaces in Wizard Generated Files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Edward Mitchell - 08 Feb 2005 16:09 GMT
Is there a way to remove the tab characters in the files that are created by
the Visual Studio Wizards.

I can set the Tab format in the Tools>Options...>Text Editor>All
Languages>Tabs so that the tab size is 4 and spaces are inserted instead of
the tab characters.  Now when I edit the wizard generated pages, I get a
mess with some lines with tabs on them (the originals) and some without.

It's the tab characters that are inserted by the Wizards when one creates a
new project - Global.asax.cs in a .NET Forms application for example - that
it would be nice to get rid of.

Ed
--
Edward E.L. Mitchell
Web: www.racesail.org
Phone: (239)415-7039
6707 Daniel Court
Fort Myers, FL 33908
Rhett Gong [MSFT] - 10 Feb 2005 06:24 GMT
Hi Ed,
We are looking into this issue currently and will post a reply after doing
some research.

Thanks for your patience,

Rhett Gong [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
Gary Chang[MSFT] - 11 Feb 2005 06:41 GMT
Hi Ed,

>Is there a way to remove the tab characters in the files that are created by
>the Visual Studio Wizards.

Do you mean the web page files whose html code will be generated and
modified by the VS.NET automatically?

If so, I am afraid this is a known issue of the current version of VS.NET,
it is a by design feature and now we havn't a good method to change this
behavior, however we receive many feedbacks on this problem and will do
some improvement on the next VS.NET "Whidbey".

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Edward Mitchell - 11 Feb 2005 13:23 GMT
Gary,

The same thing applies when creating a project that has files that are
intended to be edited.  If I create a test project for an MFC app with the
default conditions, a number of files are created - test.cpp, testdoc.cpp,
MainFrm.cpp, etc.  Everyone of these files is full of tabs put there by the
create wizard.  These are intended for me to add my own code and it's
certainly a mess when there is a mix of tabs and spaces.

Hopefully this will also be addressed in the upcoming version.

Ed

> Hi Ed,
>
[quoted text clipped - 24 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Yan-Hong Huang[MSFT] - 14 Feb 2005 05:45 GMT
Hi Ed,

Gary dones't feel well and is taking sick leave today. So I backup this
issue.

Based on my experience, all the format setting of VS.NET IDE can be found
at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/ht
ml/vxtskManagingCodeFormatting.asp

To replace Tab with Space, we can set "Insert Spaces" Option.

If you met any unexpected behavior, could you please post the detailed
repro steps here? We will follow the steps and pass it to our product team
if we can reproduce the issue.

Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
-http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
p&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Yan-Hong Huang[MSFT] - 14 Feb 2005 05:52 GMT
Hi Ed,

The repro steps mean:
1) Detailed steps when you created the project
2) Setting in IDE at that time
3) Which line of IDE generated code has that error?

Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
-http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
p&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Edward Mitchell - 14 Feb 2005 15:01 GMT
Yanhong,

I just create a new project and select Visual C++ Projects and MFC
Application.  I name the project Test and create in C:\Temp.  Hit the
"Finish" button to create the default project.

Under Tools>Options>Text Editor>Tabs I define the tab and indent sizes as 4
and the radio button "Insert spaces" is checked.

Now look at TestDoc.cpp, TestView.cpp, MainFrm.cpp.  The are all full of
tabs!

Ed

----- Original Message -----
From: "Yan-Hong Huang[MSFT]" <yhhuang@online.microsoft.com>
Newsgroups: microsoft.public.vstudio.setup
Sent: Monday, February 14, 2005 12:52 AM
Subject: Re: Can I Expand Tabs to Spaces in Wizard Generated Files

> Hi Ed,
>
[quoted text clipped - 16 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Gary Chang[MSFT] - 15 Feb 2005 09:53 GMT
Hi Ed,

>Under Tools>Options>Text Editor>Tabs I define the tab and indent sizes as 4
>and the radio button "Insert spaces" is checked.
>
>Now look at TestDoc.cpp, TestView.cpp, MainFrm.cpp.  The are all full of
>tabs!

The "Insert spaces" setting is just for the "Tab" of user's input, I mean
when you type your code in the code editor window, the setting works.
However on the other hand, those wizard generated code is some part of the
VC Wizard's template file, it is not generated by the VS.NET IDE char by
char, so the VS.NET's setting will not take effect to the VC Wizard
generated code.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Edward Mitchell - 18 Mar 2005 04:30 GMT
Just to finish the topic off!

I found the best way to remove the tabs is to select all the code in the
routine and then invoke Edit>Advanced>Untabify Selection.  This will remove
all the tabs and if the tab equivalent is set to 4 spaces, do what I want.
A litttle extra work but not impossible.  I can see that the templates that
are used have to be tabs or no-tabs consistently.

Ed

> Hi Ed,
>
[quoted text clipped - 26 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Gary Chang[MSFT] - 18 Mar 2005 07:04 GMT
Bingo Ed,

thanks for your update and sharing this useful tip with us!

Have a good day!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.