Tips and Tricks: Zooming in the VS 2010 Editor

Tips and Tricks: Zooming in the VS 2010 Editor

Rate This
  • Comments 34
You probably know that Visual Studio has an option to change your text size, but did you know you can also zoom the editor in VS 2010?  Ctrl+mouse wheel zooming has been available since the first Visual Studio 2010 CTP, but we’ve finished it by adding a zoom control and key bindings in Beta 2.  Check out this video we’ve created to demo the new Zoom functionality (this demo has video and audio, so plug in your headphones or turn up the sound).

There are several ways to zoom in and out:

  • Hold down Control and scroll your mouse wheel
  • Use keyboard shortcuts Ctrl+Shift+period (zoom in) and Ctrl+Shift+comma (zoom out)
  • Type a zoom level directly in the the zoom control in the bottom left corner of the editor
  • Select a common zoom level from the dropdown list in the zoom control

You can do everything described in this post with Visual Studio 2010 Beta 2, so I hope you’ll try out the new zoom feature and let us know what you think!

Brittany Behrens
Program Manager, Visual Studio Editor Team

clip_image002I’m Brittany, a Program Manager on the Visual Studio Editor team.  Some of you may recognize me from Connect bugs or as the main voice of @VSEditor on Twitter, and I’m responsible for a variety of Editor features.  I love hearing from customers, so please let me know what you think!

Leave a Comment
  • Please add 1 and 6 and type the answer here:
  • Post
  • Hey Brittany, that's a really amazing new!! I loved it!! Thanks! :D

  • The zooming feature that you're introducing here is what got me thinking about 'code browsing' as a first-class citizen in the IDE (which I don't really think it is right now).  I posted some thoughts on this in my wish list: http://theycallmemrjames.blogspot.com/2009/12/visual-studio-2010-wishlist.html

    A really good improvement would be that if you were below a certain zoom level - say 50% - that when you moused over method names or comments or other interesting things that the editor gave us feedback (such as magnification on the method name) and navigation (link-like behavior when clicking on inherited interfaces, for example).

    Cheers for all your work on this!

    -James

  • Great feature, and this is the only thing I still miss from Visual C++ 6.0 (which is still in use).

    Here are my suggestions for "features" in Visual Studio 2012 (which would make me actually consider upgrading)

    - increased performance (everywhere)

    - less bugs (everywhere)

    - less memory use/waste

    If you don't introduce ANY other features than these 3, I *still* believe it would be your best-selling Visual Studio tool ever (at least I hope it would) if you could do it right for once....

    I know that you put in a *lot* of effort in improving Visual Studio, but you're putting in the right effort at the *wrong* places - instead of more functionality with less quality we need less functionality with more quality !!!

    But you never know, maybe I'll be surprised by VS 2010 (but I will most likely not even try it)...

  • @Atle

    If you don't try it how would you know if it is any good?  The betas thus far released have (regrettably) focused more on the new features than perf, but there has been a huge push since Beta2 to focus relentlessly on perf + memory usage.  These areas are tricky as you never can be too fast or too svelte, it is just the usual engineering tradeoffs common to every product between resources available, customer wants and changes internally to allow us to do a wider range of things, more easily in subsequent releases.  That said, specific scenarios where perf/memory usage seem especially egregious are always helpful.  Just saying it is too slow or uses too much memory isn't actionable on a product as large and extensible as VS.

    Ryan

  • The zoom slider is now in every new application, what lead you to use the dropdown instead of a slider?

  • Hi Jan,

    The reason behind having a dropdown instead of a slider is that sliders really only seem to make sense in the context of design surfaces. When you think of programs like the office suite, they are essentially visual designers. You're laying a document out in Word, or arranging charts on a canvas like surface in Excel. This concept degrades a bit when you're talking strictly about text, purely because the granularity that is desired in designers isn't really compelling on text surfaces. Take web browsers for example, they usually use a drop down box because predefined zoom levels are easier for the user to deal with (is a 1% increase in zoom useful in that context?). Likewise, one of the things I was hoping to see is more consistency around our development-esque products, and we essentially went with the same mechanism that Expression Blend uses for its zooming (bottom left, drop down). Pragmatically, drop downs also tend to be a bit smaller than sliders. Overall though, I think there are merits to both approaches. In this case, the decision was largely based on space and the idea that code didn't benefit from the granularity of a slider interface.

    Cheers,

    Chris Granger | cgranger@microsoft.com

    Program Manager | Visual Studio Platform

  • why use a new key shortcut for zoom in and zoom out? Why not CTRL + and CTRL - like we can use in IE?  

  • Hi Matt,

    The reason is purely pragmatic; it turns out those two keys are bound to two of the most used commands in VS (go back markers). Originally, the plan was certainly to try and be as consistent with most applications out there, but I got tremendous pushback for changing those keybindings - a lot of people really rely on them. So I looked around for other applications that had zoom and what they used. I found a few instances that use the ctrl + > and ctrl + < keybindings, and we actually had precedent in VS for those as well (with the C++ image editor). I don't think it's the ideal solution by any means, but given the situation I think it was the most practical.

    Cheers,

    Chris Granger | cgranger@microsoft.com

    Program Manager | Visual Studio Platform

  • >The reason is purely pragmatic; it turns out those two keys are bound to two of the most used commands in VS (go back markers).

    That being said you (@Matt) can certainly change your keybindings if you wish so that Ctrl+ and Ctrl- are the bound keys for the editor zoom-in and zoom-out commands.  The commands you are looking for are View.ZoomIn and View.ZoomOut, and they can be changed from Tools->Customize (then click the Keyboard... button) or from Tools->Options (under the Environment->Keyboard node).

    Ryan

  • I've searched the settings but I haven't found it yet.

    I'd like to set the zoom to 90% every time I open a text or source document.

    Is there a way to set the default zoom for the text editor?

    Cheers, and keep up the good work!!

  • @Paulo:

    Although there's no built-in option for what you describe, it is possible to get closer to your desired behavior with an extension. One of my teammates (Chris Granger, who commented above) has written an editor extension called Presentation Zoom, available as a free download at http://visualstudiogallery.msdn.microsoft.com/en-us/6a7a0b57-7059-470d-bcfa-60ceb78dc752. It causes all editor instances to update their zoom level when you zoom a single editor window. The extension won't persist your zoom level between VS sessions, but it should allow you to set your zoom level once per session and have all of your files respect it.

    Hope this helps!

    - Brittany

  • Hi, I have installed VS2010 RC.

    I'm missing the "Zoom level" control for the Dependency graph view. Is it possible to enable it?

    - Voja

  • @Voja:

    This blog post and the zoom feature described are only for the Visual Studio editor itself (i.e. code view), not for design or other views.  I'd encourage you to post your question in the VSTS prerelease forum, where it should reach the team responsible for architecture tools in Visual Studio 2010.  Here's the link:  http://social.msdn.microsoft.com/Forums/en-US/vstsprerelease/threads.

    Thanks,

    Brittany

  • hi, how could i set a default zoom level (like 150%) for every editor? thanks.

  • @Richard:

    There isn't currently a way to set a new default zoom level.  If you always want larger text, your best bet is to change the font size in the editor through Tools->Options->Environment->Fonts and Colors.  This will apply to all editor windows and will persist when you close and restart Visual Studio.

    If you truly want to set the zoom level but not font size, the best we have today is the Presentation Zoom extension I mentioned in a previous comment.  It causes all editor instances to update their zoom level when you zoom a single editor window.  Setting 150% for one editor will update the zoom level all editor windows, but this will not persist between VS sessions.  This extension is available as a free download at http://visualstudiogallery.msdn.microsoft.com/en-us/6a7a0b57-7059-470d-bcfa-60ceb78dc752.

    Hope this helps!

    - Brittany

Page 1 of 3 (34 items) 123