I just want to print a cs file. But there is only 'print' button under file menu. Is it possible to see a preview before printing? Does visual studio have this option anywhere?
I don't think VS2012 has a "print preview" but you could try the following as a work-around:
Set your printer to "Microsoft XPS writer"
Print to this printer, this will produce a file you can preview.
If you are happy with how it looks in XPS you can print to your normal
printer in the XPS viewer.
try Me.PrintPreview()
...a simpler and more efficient solution seemingly would be to copy the whole document over to WordPad or a similar text editor it seems...
Related
Problem: I want to edit VBScript files from inside Visual Studio 2017, but the files have the extension '.mts' instead of '.vbs'
Theory: See helpful article here.
Steps Tried: I performed a few Registry hacks in order to get 'Script Editor' to show up as a choice in the 'Open With' menu. However, even now that 'Script Editor' is the default for MTS files, I don't get syntax highlighting when opening them. The linked article suggest that 'Script Editor' is 'rejecting' the document, causing Visual Studio to default to the base text editor, but I don't see a reason why this should be happening.
A couple of options:
Set Visual Studio Options: Tools => Options => Text Editor => File Extension. Add mts extension and set editor to Microsoft Visual Basic - that should do I think.
VbsEdit: Another alternative could be to use a VBScript tool such as VbsEdit. I tested it and it seems to apply syntax coloring even for files that do not end in *.vbs. This is a commercial tool, but is great for VBScripts. It features its own debugger and also an extensive samples library in the Samples menu (not affiliated).
Sometimes when I've change some file and type Ctrl+S, Visual Studio 2013 Professional doesn't save it in normal way but propose me Save this file as... in Save File Dialog and then in folder with my file appears another file like xjxklb2q.10h or brq1p3lm.0gi. Anybody knows what is going on?
I'd log a bug to Visual Studio. If you look in the top right corner there's a smiley face that allows you to "send a frown" - just describe what you were doing and it will be picked up by someone in the platform team.
My text editor in Visual Studio 2013 I was making is complete however now I need to figure out how I can save the settings (font, background color, font color etc) so when the user exits the program these settings will be saved somehow like in a .ini file but I have no clue how I am gonna make a function like that.
Any ideas?
I'm trying to print C# code from Visual Studio 2010 to a Konica BizHub Color Printer. Only the line numbers are printing in color. Does anyone know if there is some Visual Studio setting or plug-in to allow the text of the code to be printed in color?
There is a free extension available now, that puts back in color printing. Not all 2008 'features' are supported, but you get color:
http://visualstudiogallery.msdn.microsoft.com/00ec88c2-1553-47d2-8170-3c5baa0c6e44/
It's impossible to do from VS2010 without 3rd party tools. They cut in from production due to time constraints.
There are some tools such as this that have a workaround though
http://www.starprinttools.com/
Or you could always copy and paste into Word or an e-mail or something
Good luck!
In Visual Studio 2008, I've used a nice feature in its XAML editor which breaks a line so that a control's attributes are automatically positioned on new lines: one attribute per line.
Is there a way to do the same for the HTML editor?
Thank you.
Oded, thank you very much! You gave me an idea on how to apply "one attribute per line" formatting to an ASP.NET document:
In Visual Studio 2008, right-click on the .aspx file in the Solution Explorer.
Select "Open With..".
Select "XML Editor". [Assuming that the XML Editor has been properly configured in Tools->Options prior to doing this.]
Edit -> Advanced -> Format Document.
This reformats the document so that each attribute is positioned in its own line, and all of them are nicely indented.
Of course, if I later reopen the same file in Web Forms Designer and format it again, it goes back to what it looked like before.
But for my purposes (easily finding the required attributes in a large file), this temporary solution is quite sufficient.
Once again, thank you very much!
Best regards,
Dmitriy