Visual Studio 2010 doubleclick behind #region to open it? - visual-studio-2010

in Visual Studio 2008 it was possible to open a collapsed #region by simply double clicking somewhere behind (to the right) of the #region.
Now in VS 2010 you have to double click exactly the #region, double clicking behind it just selects the #region.
I've browsed the options but didn't find anything helpful and neither did google help.
Does anyone know of a way to switch back to the old behavior?
Thanks,
Florian

In Visual Studio 2010 the editor has been rewritten from scratch. It is quite likely that they just "forgot" to re-implement this functionality, thus causing a regression. If you feel strongly about bringing it back, I'd open a new bug at https://connect.microsoft.com/visualstudio/feedback

I don't think you can do it with the mouse anymore. Your best alternative is Ctrl+M, M (that toggles the current outline section).

Related

Prevent Visual Studio to scroll to the end of file when pressing Ctrl A (select all)

It's basically in the title.
Whenever you "select all" in the Visual Studio code editor, the editor will scroll down to the bottom of the file. Is there a way to prevent this?
I'm using Visual Studio 2008 at the moment, but this applies to all versions.
No, you cannot change this behavior.
Microsoft has been aware of this since at least VS 2010, but either doesn't think it's a bug or doesn't think it's important enough to fix.
From their response to a 2010 bug report filed on the issue:
We unfortunately do not plan to change Ctrl+A's scrolling at this
time, so we're unfortunately resolving this issue as Won't Fix for VS
2010. However, it will remain in our database to be revisited for a future release of Visual Studio.
Source: Microsoft Connect
A quick Ctrl-Z-Ctrl-Y will get you back to where you were. If you tend to do a Ctrl-S Ctrl-A Ctrl-C a lot then just get used to this whole chain instead: Ctrl-SACZY. Or, create a macro: https://msdn.microsoft.com/en-us/library/a0003t62%28v=vs.90%29.aspx
I was struggling with this myself, but the "undo" suggestion gave me an idea and I feel kinda dumb for not thinking of it earlier. Visual Studio includes "Navigate Backwards" and "Navigate Forwards" buttons (CTRL-, and CTRL+, respectively). So after you finish selecting and copying, simple click the navigate backwards button or type CTRL- and voilĂ ! you're back where you were.
I know it doesn't stop the scroll to begin with, but at least it puts your cursor back exactly where you left it!

How to place code snippets within Visual Studio 2010 Toolbox window?

I've really enjoyed Anders Hejlsberg presentation at BUILD 2011 and it's not the first time that I notice someone having a collection of code snippets available within Visual Studio's Toolbox window, so given that all the searches I've performed so far pointed me to how to deal with IntelliSense snippets, I was wondering if anyone knows how to achieve this?
You just need to copy the code to the toolbox. A simple selection of the code, and a drag and drop to the toolbox just make it available. It will not be deleted until you delete it (at least that never happens to me by itself)..
This is what you need?

Visual Studio 2010's Solution Explorer is too sensitive

If I click on something (that is click and let go) in the solution explorer and move the mouse too quickly on two quickly or click on something else too soon, Visual Studio interpretes that as a move. I'm hooked up to Visual Source Safe, so most of the time it asks me if I'm sure. But every once in a while it doesn't, and I have no idea the file has been moved/copied. As a result I get compiler errors (or worse runtime issues) that are nearly impossible to track down. Is there a fix to this? Any suggestions? It is very annoying.
Try the VSCommands extension
They have a "Prevent accidental Drag & Drop in Solution Explorer" feature

Highlight all references to X?

The Eclipse IDE has a neat little feature that I really miss in Visual Studio.
If I place the cursor on a variable or method name, the IDE will automatically highlight all references to it in the current document within the relevant scope.
I can't seem to find an option to turn on similar behaviour in VS2008 or Resharper 4. I know VS has a Find Usages function, but I'd like to do it automatically on the fly.
Does anyone know of a free addin which will add this functionality?
If you're using ReSharper, you can highlight the usages in the file with Shift-Alt-F11. Place your cursor on the variable you want to find usages of, and press the Shift-Alt-F11 combination.
There is an add-in for Visual Studio that will do something similar called RockScroll.
When you double click on something, it will highlight all occurrences of the item you double clicked. It also changes the vertical scrollbar to a "syntax highlighted thumbnail view" showing an overview of where the item occurs in the file.
I know you mentioned ReSharper, but CodeRush has a nice references window that you can dock and let it search for things on-the-fly or on demand. As a bonus, you can select each usage and it will show you the context surrounding the usage. It also works for methods.
I mentioned CodeRush since they have an express edition, which looks like it includes that feature, but I haven't tried that edition.
Visual Studio 2010 has sorta implemented this, but the feature is somewhat lacking. There is a non-configurable delay between placing the cursor and highlighting.
The RockScroll Addin is not available for Visual Studio 2010 and above.
As a replacement, the free "Highlight all occurrences of selected word" plugin will highlight all occurences of the selected string after a doubleclick. There is no delay as with the native vs2010 highlighter.
It is string-based, which means it works inside comments and string literals.
Microsoft published a tool that sort of does what you want.
Some of my favourite features:
Enhanced Scrollbar
Auto Brace Completion
Ctrl + Click Go To Definition
Open Containing Folder
and the list goes on.
For Visual Studio 2010 and for Visual Studio 2012

Keyword highlighting on selection in Visual Studio 2008

A little while ago I managed to get Visual Studio 2008 (C++) into a state where, if I would select a keyword (or any symbol for that matter), by either double clicking on it or highlighting it, all other instances of that symbol within the current file would become highlighted too.
This was a really useful feature.
Since then it's gone away, and I don't know how to get it back.
Please help.
#Sander - that'll be it. Thanks!
I think you've installed RockScroll. It also lights them up in the graphical scrollbar (its main feature)
I use MetalScroll, it's like RockScroll only better; it doesn't interfere with Resharper (a VS must-have) and you can set it up to only highlight if you hold down 'alt' when you double-click.
There is something called "WordLight" by Mikhail Nasyrov.
An add-in for Visual Studio 2008 that highlights all occurrences of a selected text.
It searches and highlights substrings that are currently selected in a text editor.
Can be found at below link
WordLight
https://marketplace.visualstudio.com/items?itemName=MikhailNasyrov.WordLight

Resources