Posts tagged 'Tool Windows'

Tuesday, December 2, 2014

Tip 4.32: You can use Shift+Esc to close a tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



As she has said time and time again on her blog, it's really the simple things in life.... she keeps forgetting about this tip, until she sees this keyboard shortcut and has to look up what it does.

Use Shift+Esc to close the currently selected tool window. If the focus is not on a tool window but in an editor, and you press Shift+Esc, Visual Studio will just look at you.



Happy Programming! =)
Posted by Nils-Holger at 1:21 PM with 0 comments.

Monday, December 1, 2014

Tip 4.31: How to access a toolbar within a tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You may have noticed that within tool windows such as the Solution Explorer, you cannot reach the toolbar by hitting Tab or using the arrow keys. The keyboard shortcut to reach a tool window's toolbar is Shift+Alt. Note that Alt+Shift will not work.



Happy Programming! =)
Posted by Nils-Holger at 12:44 PM with 0 comments.

Saturday, November 29, 2014

Tip 4.29: How to drag a tool window around using the keyboard

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



With the desired tool window selected, press Alt+Minus to bring up the tool window menu. Press the Down Arrow to select the Move command, and press Enter. Now you can control the tool window with the arrow keys.



To dock, simply use the arrow keys to get to the desired dock target and hit Enter to commit to docking the tool window to the new location.

Happy Programming! =)
Posted by Nils-Holger at 1:08 PM with 2 comments.

Friday, November 28, 2014

Tip 4.28: How to customize what clicking the X button does to a tool window or tool window tab group

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Tools–Options–Environment–General page, you'll find the Close Button Affects Active Tool Window Only check box. The following screen shot shows a snapshot of two tool window tabs docked together, with the close button circled.



If you want only Solution Explorer to close when pressing the X button, enable the option. Otherwise, both tool windows will close.

Happy Programming! =)
Posted by Nils-Holger at 12:50 PM with 2 comments.

Thursday, November 27, 2014

Tip 4.27: How to use Ctrl+Page Up and Ctrl+Page Down to navigate among all the tool windows in a tool window group

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Whenever tool window tabs are docked together, they form a little group that you can move around and such, as you've seen in previous tips.



You can use Ctrl+Page Up and Ctrl+Page Down to navigate among the tool windows in this group.

Happy Programming! =)
Posted by Nils-Holger at 12:40 PM with 0 comments.

Wednesday, November 26, 2014

Tip 4.26: You can use Alt+F6 and Alt+Shift+F6 to cycle through opened tool windows

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of "Sara Ford"

Sara Ford's Blog



If you don't want the IDE Navigator to appear when you navigate among various opened tool windows, use Alt+F6 and Alt+Shift+F6 to go to the next and previous tool windows, respectively, in most-recently used sort order.



Happy Programming! =)
Posted by Nils-Holger at 12:51 PM with 0 comments.

Tuesday, November 25, 2014

Tip 4.25: You can use Alt+F7 and Alt+Shift+F7 to move to the next and previous tool windows

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The tool windows you open and visit are saved in an MRU (most-recently used) list. So you can navigate among all the various opened tool windows, using Alt+F7 for next and Alt+Shift+F7 for previous.



Happy Programming! =)
Posted by Nils-Holger at 1:00 PM with 0 comments.

Monday, November 24, 2014

Tip 4.24: How to use Tabbed Document to maximize a tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Yet another one of those "Wow, she didn't know you could do that until someone showed her" moments happened when she found out you can maximize a tool window by setting it to a tabbed document state. With your desired tool window selected, either right-click the tool window title bar or tab window to bring up the tool window context menu and then select Dock as Tabbed Document. Alternatively, you can go to the Window menu and select Tabbed Document.



Happy Programming! =)
Posted by Nils-Holger at 1:08 PM with 0 comments.

Sunday, November 23, 2014

Tip 4.23: Why would you want to make a tool window float?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog

Recall from earlier in this chapter how tool windows are available in five different states:
  • Floating
  • Dockable
  • Tabbed document
  • Auto Hide
  • Hide


She would say that the dockable state actually represents two mutually exclusive positions the tool window can be in:

  • Docked The tool window is locked to a specific location, usually to the side of the IDE.
  • Hovering This is her made-up term to describe a tool window that is in the dockable state but is not docked. Recall that the dockable state is different from a floating state, because the floating state cannot be docked.


Most of these states are self-explanatory, especially after a little bit of trial and error, but the floating state may be less obvious. In a floating state, the tool window hovers over the IDE but cannot be docked to a fixed position in the IDE.



How is this useful? Sometimes you just want to position a tool window in a certain area and, unfortunately, the dock targets appear. If you set it to Floating, you never get docking targets for the tool window. (See Tip 4.13.)

Happy Programming! =)
Posted by Nils-Holger at 1:26 PM with 0 comments.

Saturday, November 22, 2014

Tip 4.22: You can speed up or slow down how fast a tool window slides out from a docked position

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Tools–Options–Environment–General page, you'll find the Animate Environment Tools check box. This option controls the speed at which a tool window slides in and out of an autohide state.



Additionally, you can opt out completely from the animation effect by unchecking the Animate Environment Tools check box. If you do that, tool windows pop to their new locations rather than sliding to them.

Happy Programming! =)
Posted by Nils-Holger at 12:33 PM with 446 comments.

Friday, November 21, 2014

Tip 4.21: You can use Shift+Click to automatically dock an autohiding tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

She thought she had discovered a bug where "Shift+clicking a tool window that is docked at the bottom of the IDE causes the window to disappear instead of docking." But after repro-ing on someone else's machine (it is so important to get a repro on another machine when you are not sure), she realized that it occurred anywhere. Then she realized what the "bug" was.... If the tool window is still sliding out, it will dock. But if the tool window hasn't started to slide out yet, Shift+Click will perform a Hide command. So this tip is based on both behaviors.


Let's start with "Tool Window 101" training. When a tool window is docked (as discussed in Tip 4.13), you have the option to autohide. Just click the autohide push pin as shown in the following image. Or go to the Window menu and choose Auto Hide to autohide the currently selected tool window.



Clicking this push pin causes the window to autohide, as shown here:



You can mouse over the Solution Explorer and click the push pin again to redock. Or you can go to the Window menu and choose Auto Hide, which unchecks the Auto Hide setting. But what's the fun in that?

Now for the actual tip. Did you know that you can press Shift+Click on the autohiding tool window (the second picture in this tip) to move it into a docked state?

However, if the tool window is already sliding out (as shown in the next screen shot), it is automatically hidden.



So you are probably wondering, "Okay Sara, so what is Shift+Click really supposed to do?" It is supposed to perform a Window.Hide command. But when the tool window starts to slide, stuff happens in the IDE and it goes into a docked state instead of a hide state.

More than you ever wanted to know about the Visual Studio environment, huh?

Happy Programming! =)
Posted by Nils-Holger at 12:21 PM with 429 comments.

Thursday, November 20, 2014

Tip 4.20: You can double-click the tool window title bar to redock the tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog

After you drag a tool window to an undocked position, you can quickly redock the tool window to the previous location by double-clicking the title bar.



Also, you may notice some tool windows are in tool window groups (as shown in the following image), whereas others are docked individually. To separate a tool window from its group, either drag away or double-click the tool window tab, as shown in the following screen shot.



Happy Programming! =)
Posted by Nils-Holger at 1:24 PM with 442 comments.

Wednesday, November 19, 2014

Tip 4.19: You can show autohiding tool windows via the tool window autohide channel

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



This is one of those features she always forgets. The window management developer and she were discussing another tip, when he showed her the autohide channel context menu.

Right-click the tool window autohide channel to invoke the context menu, and click one of the tool windows to slide it out from hiding.

Note in the picture that the Solution Explorer and Class View tabs are side by side, whereas the Properties tab has some space separating it from the other tabs. This is because Solution Explorer and Class View are docked together and the Properties browser is docked next to it, along the edge.



Happy Programming! =)
Posted by Nils-Holger at 1:16 PM with 441 comments.

Tuesday, November 18, 2014

Tip 4.18: You can customize how pressing a tool window push pin autohides the tool window or tool window tab group

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog

On the Tools–Options–Environment–General page, you'll find the Auto Hide Button Affects Active Tool Window Only option. The next illustration is a snapshot of two tool windows docked together with the Auto Hide push pin circled.



If you want autohide to apply only to Solution Explorer when you click the push pin, enable the option. Otherwise, autohide will apply to both tool windows.

Happy Programming! =)
Posted by Nils-Holger at 1:12 PM with 448 comments.

Monday, November 17, 2014

Tip 4.17: You can autohide all of your tool windows with one command

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Window menu, there's the Auto Hide All command. Your environment can go from looking like the following screen shot, with lots and lots of tool windows open:



to looking like this screen shot:



However, there is one caveat: there isn't a command to slide out all of your tool windows.

Happy Programming! =)
Posted by Nils-Holger at 1:53 PM with 449 comments.

Sunday, November 16, 2014

Tip 4.16: You can use docking targets to dock tool windows in new and crazy ways

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

Docking targets are hands-down her all-time favorite feature that she tested. Oh, the fun she would have opening bugs like "Tool Window client area resizes to a negative size after redocking to same location 100-plus times." (Yes, the bug was fixed.)


When you drag a tool window over a docking target, you'll get a preview, as you see in the next screen shot.



But, let's have a little fun ...

She has no idea how the tool window tab group shown next could be useful, but maybe if it were resized to fit a secondary monitor ...



Can you tell she enjoyed being a tester?

Happy Programming! =)
Posted by Nils-Holger at 12:16 PM with 442 comments.

Saturday, November 15, 2014

Tip 4.15: You can dock a tool window to the top of the IDE

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



She implied this possibility existed in a previous tip when she introduced all the various IDE docking targets (see Tip 4.13). But she wanted to call it out specifically since it is rare to see a tool window in this position.



The Memory tool windows (when you're in debugging mode) are the only ones that come to mind right now. But there's nothing preventing you from docking your own tool windows up there, as illustrated with the Solution Explorer in the preceding screen shot.

Happy Programming! =)
Posted by Nils-Holger at 12:58 PM with 440 comments.

Friday, November 14, 2014

Tip 4.14: How to undock only a single tool window from a group

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can always undock a single tool window by dragging its tool window tab.



Happy Programming! =)
Posted by Nils-Holger at 1:12 PM with 445 comments.

Sunday, June 8, 2014

Tip 6.3: What settings are contained in the New Project Dialog Preferred Language category

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



If you go to Tools–Import And Export Settings–Export Settings, you'll see the list of categories that can be contained in a .vssettings file. The first category she wants to discuss is the New Project Dialog Preferred Language category.

VSTip6300

As noted in the description, it organizes the New Project Dialog folders based on the preferred language. If C# is preferred, all the C# projects are listed at the top of the list and all the others are collected toward the bottom. The General Development Settings use the defaults that have been familiar since the Visual Studio .NET 2002 days, as shown here:

VSTip6300a

Now let's see the dialog box using the Visual C# Development Settings. Note how Visual Basic and Visual C++ fall into the newly created Other Languages node.

VSTip6300b

Happy Programming! =)
Posted by Nils-Holger at 11:08 AM with 438 comments.

Thursday, June 5, 2014

Tip 5.51: You can use the View.Forward (Alt+Right Arrow) and View.Backward (Alt+Left Arrow) global commands in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



In Tip 5.36, she discussed how you can navigate forward and backward with the Alt+Minus and Shift+Alt+Minus keyboard shortcuts, which are scoped specifically to the Object Browser. But there are two other commands, View.Forward and View.Backward, that also work in the Object Browser, just like Alt+Minus and Shift+Alt+Minus.

View.Forward and View.Backward are global, meaning that other features within the IDE can use them. For example, Class View uses them in the same way as the Object Browser. But you're probably most familiar with these commands as Web Browser Forward and Web Browser Backward. If you are accustomed to using these commands elsewhere in the IDE, you'll feel right at home in the Object Browser.

VSTip5510

Happy Programming! =)
Posted by Nils-Holger at 12:38 PM with 0 comments.

Wednesday, June 4, 2014

Tip 5.50: Why the Object Browser has so many commands you can bind to (and how to create a keyboard shortcut to clear the search results)

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

As she has been writing the Object Browser tip series, she has noticed that there are a lot of commands available under Tools–Options–Environment–Keyboard. Just type ObjectBrowser and you'll see what she means.


VSTip5500

Technically, not all these commands need keyboard shortcuts. For example, the ability to sort objects by access level probably doesn't need a keyboard shortcut. But since they do have shortcuts, let's have some fun.... If you bind any of the Object Browser Settings options to a keyboard shortcut, you'll see that shortcut in the drop-down menu. She didn't know that until she started playing with this feature.

VSTip5500a

How can you take advantage of this? If you use the Object Browser a lot to search, you might find it meaningful to clear the search via the keyboard shortcut. The command View. ObjectBrowserClearSearch clears the search combo, thus clearing the Object Browser filter.

Happy Programming! =)
Posted by Nils-Holger at 12:06 PM with 443 comments.

Tuesday, June 3, 2014

Tip 5.49: You can export all your Object Browser customizations in a .vssettings file

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio" courtesy of 'Sara Ford'

Sara Ford's Blog



Over these past several tips, we've taken a close look at customizing your Object Browser experience, from sorting to searching to filtering, among other options.

Your customizations can be saved to a .vssettings file via the Tools–Import And Export Settings dialog page, under General Settings–Object Browser Options.

VSTip5490

The good news is that the XML stored in the created .vssettings file for the Object Browser Settings is human readable, in case you need to make a quick tweak.

Happy Programming!
Posted by Nils-Holger at 12:11 PM with 448 comments.

Monday, June 2, 2014

Tip 5.48: How to use type-ahead selection support in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You may have tried this tip on your own, just hoping it would work. But in case you never thought about it, the Object Browser supports type-ahead selection.

VSTip5480

Sara Aside

Back in the Visual Studio .NET 2003 days, she was on a quest for a while to have all lists in the IDE support type-ahead selection. She did what she could, so if you see a list that should support it and it doesn't, definitely file a bug with the Visual Studio Team. Maybe one day her quest will be completed.


Happy Programming!
Posted by Nils-Holger at 12:23 PM with 442 comments.

Sunday, June 1, 2014

Tip 5.47: You can use a Find Symbol search (Shift+F12) in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Just like the previous tip that talked about going to an object's or function's definition, you can find all the references of what you have selected in the Object Browser.



The command Edit.FindAllReferences is bound to Shift+F12. When you press Shift+F12, it brings up the Find All References window.



This is the same as using Find Symbol in the Find In Files window.

Happy Programming! =)
Posted by Nils-Holger at 12:20 PM with 440 comments.

Saturday, May 31, 2014

Tip 5.46: You can use F12 in the Object Browser to go to the definition of whatever is selected

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the context menu of both the Member pane (right panel) and the Object pane (left panel), you'll see the Go To Definition command. You can use this command to navigate directly into the code where whatever you have selected is defined (or you'll get a nice error message).

VSTip5460

The Edit.GoToDefinition command is bound to F12. Pressing F12 in the image just shown takes you to where Create() is defined in the code.

Happy Programming! =)
Posted by Nils-Holger at 12:30 PM with 467 comments.

Friday, May 30, 2014

Tip 5.45: What are the two primary means of searching for objects in the Object Browser?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Now we'll move to the second toolbar in the Object Browser, which is all about searching.

VSTip5450

The search scope depends on what you have selected in the Object Browser Scope. For example, if you try to search for System.Web in a Console Application, you will not be very successful. There's also another way to search—it's using the Find And Replace window's Find Symbol functionality. You'll notice the Find Symbol search closely resembles the Object Browser search functionality.

VSTip5450a

Happy Programming! =)
Posted by Nils-Holger at 12:44 PM with 437 comments.

Thursday, May 29, 2014

Tip 5.44: You can show extension methods in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



This tip is new for Visual Studio 2008. You can learn more about extension methods in the documentation located at http://msdn.microsoft.com/en-us/library/bb384936.aspx for Visual Basic and http://msdn.microsoft.com/en-us/library/bb383977.aspx for C#.

In Object Browser Settings, you'll see the Show Extension Methods option.

Now, when you have an extension method in your code (in her example, it's a module because she's using Visual Basic), you'll see a downward-pointing arrow.

VSTip5440

Happy Programming! =)
Posted by Nils-Holger at 1:30 PM with 443 comments.

Wednesday, May 28, 2014

Tip 5.43: How to stop displaying all inherited members in the Object Browser Member pane

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The next option in Object Browser Settings is Show Inherited Members. When this option is enabled, you'll see all inherited members, including those inherited from System.Object.

VSTip5430

When this option is disabled, you'll see only Method1(), Method2(), and Method3(). Happy Programming! =)
Posted by Nils-Holger at 12:33 PM with 448 comments.

Tuesday, May 27, 2014

Tip 5.42: What does Other mean in Show Other Members in Object Browser Settings?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The Other in the Show Other Members option represents members that do not have an access level of public, private, protected, or inherited. For example, access levels of Friend (in Visual Basic) and Internal (C#) fit into this Other category.

The Object Browser shows the Friend method with a blue diamond.



Happy Programming! =)
Posted by Nils-Holger at 1:05 PM with 442 comments.

Monday, May 26, 2014

Tip 5.41: You can mark methods and types as Hidden so that they don't appear in Microsoft IntelliSense or in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio, in ", courtesy of 'Sara Ford'

Sara Ford's Blog



Continuing from Tip 5.40, this tip is how to actually make something hidden or capable of being hidden.

In the System.ComponentModel namespace, there's the EditorBrowseableAttribute class.

Going back to the previous tip's Method1() and Method2() methods, you'll see in the following example how Method2() doesn't appear in IntelliSense, just like it doesn't appear in the Object Browser.

VSTip5410

Of course, you can still complete the line just shown with Method2(), and everything will compile successfully.

Happy Programming! =)
Posted by Nils-Holger at 11:20 AM with 444 comments.

Sunday, May 25, 2014

Tip 5.40: You can hide or show hidden members and types in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

She never officially tested the Object Browser but rather played back-up tester in case someone went on vacation, needed help analyzing failures during a full test pass, and so forth. When she wrote most of these tips, she had to browse the test cases and the documentation to make sure she described things consistently and to make sure she was not missing any functionality.


This tip is about the Show Hidden Types And Members option on the Object Browser Settings menu.

VSTip5400

When this option is enabled, any hidden types and members will appear, but they'll appear in a grayed-out state, as shown next in the Method1() and Method2() example, where Method2() is hidden.

VSTip5400a

Happy Programming! =)
Posted by Nils-Holger at 11:46 AM with 441 comments.

Saturday, May 24, 2014

Tip 5.39: You can choose whether to show base types in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



In the Object Browser Settings menu, there's the Show Base Types option.

VSTip5390

In the following example, MarathonController inherits from ControllerBase. When this option is enabled, under MarathonController you'll see the Base Types folder. If you've been wondering how to get rid of this (or have been wondering how to enable it), just toggle the setting.

VSTip5390a

Happy Programming! =)
Posted by Nils-Holger at 12:15 PM with 434 comments.

Friday, May 23, 2014

Tip 5.38: You can customize both your Object pane and Members pane in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Over the next several tips, we're going to take apart the Object Browser Settings menu that lists what appears in the Object Browser.

VSTip5380

The first set of options control your view preference in the Object pane, which is either by namespace or by containers. Think of these two options as a set of radio buttons that are mutually exclusive. The rest of the options are more like check boxes, since you can have all the show options enabled.

If you choose View Namespaces (which is the default), all components are shown based on their namespace, just as you would expect. The idea here is that namespaces stored in multiple physical containers are merged, as shown here:

VSTip5380a

Now if you switch to View Containers, you'll see the physical containers, and then a breakdown of the namespaces that are contained in each.

VSTip5380b

Sara Aside

She always uses View Containers so that she doesn't feel so overwhelmed by seeing everything! =)


Happy Programming! =)
Posted by Nils-Holger at 11:57 AM with 436 comments.

Thursday, May 22, 2014

Tip 5.37: You can create a keyboard shortcut for adding references to a solution from the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

She was kind of surprised to see it in the list of commands. But, then again, one can never have too many keyboard shortcuts. =) To write this tip, she bound it to her pseudo random keyboard shortcut Ctrl+Alt+Shift+T. This is her generic, all-purpose keyboard shortcut that she uses for testing purposes.


As far as binding View.ObjectBrowserAddReference to a keyboard shortcut goes, she'll leave it up to you to decide how useful this is. Maybe the "keyboard shortcut for everything" users will enjoy it. As long as some object has selection—meaning it doesn't have to have focus (blue highlight) and has at least inactive selection (light gray highlight)—in the Objects pane (the leftmost pane), you'll get the following message box when you press the keyboard shortcut.

VSTip5370

And if there's nothing selected (meaning you probably have absolutely nothing in the Object Browser) and you press the keyboard shortcut, Visual Studio will just stare at you.

Happy Programming! =)
Posted by Nils-Holger at 12:32 PM with 440 comments.

Wednesday, May 21, 2014

Tip 5.36: How to use navigate forward and back in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Another set of buttons on the Object Browser toolbar belongs to the Navigate Forward and Navigate Back actions.

VSTip5360

The pages you visit within the Object Browser are saved in MRU (most-recently used) order.

This alone is somewhat exciting, but what really makes it exciting is a keyboard shortcut!

The commands are View.ObjectBrowserForward and View.ObjectBrowserBack. If you are using the Visual Basic Development Settings, you'll see that the keyboard shortcuts are Alt+Minus for Back and Shift+Alt+Minus for Forward. If you use the Forward and Back functionality frequently and are not using the Visual Basic Settings, go to Tools–Options–Environment–Keyboard, and manually set the keyboard shortcuts there.

Happy Programming! =)
Posted by Nils-Holger at 12:10 PM with 0 comments.

Tuesday, May 20, 2014

Tip 5.35: You can add references to your solution directly from the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Let's say that you find the component that you want to add to your solution. Typically, you go to Solution Explorer, right-click the project node and select Add References, bring up the Add Reference dialog box, and you know how the rest goes.

Within the Object Browser, there's a toolbar button called Add To References located to the right of the "..." browse button and the forward/back navigation buttons.

With the Accessibility assembly selected, click the Add To References In Selected Project In Solution Explorer icon to add the assembly.

VSTip5350

And now you'll see the Accessibility assembly added to the project.

VSTip5350a

Happy Programming! =)
Posted by Nils-Holger at 1:28 PM with 444 comments.

Monday, May 19, 2014

Tip 5.34: You can create a custom list of components for the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can create a custom components list for the Object Browser. There are two ways to reach the Edit Custom Component Set dialog box. Either click that little "..." browse button next to the combo box or click the Edit Custom Component Set option in the Browse combo box.

VSTip5340

Now you'll see the Edit Custom Component Set window, where you can add and remove components. And for old time's sake, she has added an Accessibility assembly.

VSTip5340a

Finally, when returning to the Object Browser, you get the following view.

VSTip5340b

Happy Programming! =)
Posted by Nils-Holger at 12:26 PM with 443 comments.

Sunday, May 18, 2014

Tip 5.33: You can specify to show components in your solution only in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



By default, the Object Browser shows you all the components in the latest .NET Framework version. But sometimes you don't need to know about the entire world, and you just want to focus on the objects in your solution.

In the upper-right corner of the Object Browser, you'll see a Browse combo box. If you drop down the combo box list, you'll see the option for selecting My Solution.

VSTip5330

Happy Programming! =)
Posted by Nils-Holger at 12:51 PM with 444 comments.

Saturday, May 17, 2014

Tip 5.32: You can use Ctrl+Alt+J to open the Object Browser window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog

You can use Ctrl+Alt+J to open the Object Browser window. The command is View.ObjectBrowser.

VSTip5320

Happy Programming! =)
Posted by Nils-Holger at 12:29 PM with 439 comments.

Friday, May 16, 2014

Tip 5.31: You can create keyboard shortcuts to navigate among the various Task List categories (by using View.NextTask and View.PreviousTask)

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



F8 and Shift+F8 are bound to the commands Edit.GoToNextLocation and Edit. GoToPreviousLocation. When the Task List is visible, these keyboard shortcuts navigate throughout all the tasks listed in a given category.

However, if you want to navigate at any time among your various TODO comments or other tasks, regardless of whether the Task List is open, the Task List comes with two commands for doing this: View.NextTask and View.PreviousTask.

Because we've already explored more than you ever wanted to know about the Task List, you now know that the Task List has several categories: User Tasks, Comments, and Shortcuts. These commands navigate only among items of a given category, so you won't jump from Shortcuts to User Tasks.

Note that these commands are not bound to a keyboard shortcut by default in the General Development Settings, so you may need to bind them yourself, depending on your development settings.

VSTip5310

Go to Tools–Options–Environment–Keyboard, and in the Show Commands Containing edit box, type the command View.NextTask.

Do a sanity check for whether the settings you are using already have the command bound to a keyboard shortcut. If a command is already bound to a keyboard shortcut, you'll see it in the Shortcut Currently Used By read-only combo box, which you can see in the preceding screen shot.

If the command is not bound to a shortcut, in the Press Shortcut Keys edit box, type your preferred shortcut and click Assign. If you want this command to work only in the editor and not anywhere else in the IDE, use the Text Editor scope under the Use New Shortcut In drop-down list.

Rinse and repeat for the View.PreviousTask command. For her, she used Ctrl+Alt+N, only because it wasn't bound to anything in the General Development Settings. For the previous action, she highly recommends just adding the Shift key to whatever key combination you come up with for View.NextTask, since the standard convention for any backward navigation is to include Shift.

Also, something else to note, because she had to test for it, is that the Visual Studio status bar will update with the name of the comment when you use View.NextTask or View.PreviousTask.

VSTip5310a

Happy Programming! =)
Posted by Nils-Holger at 12:11 PM with 441 comments.

Thursday, May 15, 2014

Tip 5.30: You can show a full file path in the Task List

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



This tip applies only to comments and shortcuts, as user tasks are not saved with a file. Go to Tools–Options–Environment–Task List, and uncheck the Hide Full File Paths check box.

VSTip5300

And now the Task List displays the full paths for shortcuts.

VSTip5300a

Happy Programming! =)
Posted by Nils-Holger at 12:05 PM with 437 comments.

Wednesday, May 14, 2014

Tip 5.29: How to disable the prompt for deleting the Task List's user tasks

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



If you've created a few tasks and deleted them over time, you may have found that delete confirmation prompt to be annoying. Here's how you can disable it. On each user task, you'll see the Delete command on the context menu, as shown in the following screen shot.

VSTip5290

And when you click it, you'll get this prompt:

VSTip5290a

To disable this prompt, go to Tools–Options–Environment–Task List, and uncheck the Confirm Deletion Of Tasks check box.

VSTip5290b

Happy Programming! =)
Posted by Nils-Holger at 12:23 PM with 437 comments.

Tuesday, May 13, 2014

Tip 5.28: You can show HACK, UNDONE, and custom tokens in the Task List

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



TODO comments are not the only thing you can display under Comments in the Task List. If you go to Tools–Options–Environment–Task List, you'll see a Token List. By default, the Token List comes with HACK, UNDONE, and TODO, but you can create your own.

VSTip5280

Using a user-created TipOfTheDay token, she can type a comment in her code using the //TipOfTheDay token format, as shown here:

VSTip5280a

The TipOfTheDay comment now appears in the Task List.

VSTip5280b

Happy Programming! =)
Posted by Nils-Holger at 12:11 PM with 445 comments.

Monday, May 12, 2014

Tip 5.27: You can create shortcuts in your Task List

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

This is yet another feature she didn't know about until someone showed her.
You can store shortcuts in your Task List, and you can even use them as tasks to scratch off, if you want. And just like user tasks, shortcuts are saved in your solution .suo file, so they won't get checked into the source control. To create a Task List shortcut, go to the desired location in your editor (which can be any line of code or comment) and then go to Edit–Bookmarks–Add Task List Shortcut.

VSTip5270

Now you'll notice the shortcuts curved-arrow glyph appears in the indicator margin.

VSTip5270a

And now in the Task List, you'll see a new category called Shortcuts.

VSTip5270b

As illustrated in the preceding screen shot, you can also rename these shortcuts by double-clicking the description (or tabbing to the description field, for keyboard users) and then typing a new name.

Sara Aside

You may be wondering what the difference is between bookmarks and Task List shortcuts. At a high level, you won't see much difference. But, at the feature level, Task List shortcuts provide a few differences. Task List shortcuts display the entire line of code in the Task List window. Also, you can set a priority and check off these shortcuts as you complete them.


Happy Programming! =)
Posted by Nils-Holger at 12:25 PM with 442 comments.

Sunday, May 11, 2014

Tip 5.26: How to create and view TODO comments in the Task List

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Let's focus now on the other aspect of the Task List: the comments left in the code. You need to drop down the combo box at the top right to show Comments to be able to see your comment tokens (for example, UNDONE, TODO, and HACKS) in the Task List.

VSTip5260

So let's say that you have a TODO comment in your code as shown here.

VSTip5260a

By going to the Comments view in the Task List, you can now see your TODO comment.

VSTip5260b

Happy Programming! =)
Posted by Nils-Holger at 11:07 AM with 439 comments.

Saturday, May 10, 2014

Tip 5.25: You can assign a priority to your Task List's user tasks

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Now that you've created a user task, you can assign a priority. She calls this out as a separate tip, as it is most likely not intuitive that you can do this. Under the ! (exclamation point) column, you can click any cell to pop open the priority combo box.

VSTip5250

Then you'll be able to view and sort your user tasks based on priority.

VSTip5250a

Happy Programming! =)
Posted by Nils-Holger at 11:55 AM with 443 comments.

Friday, May 9, 2014

Tip 5.24: You can use the Task List to create user tasks that are separate from your code

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



A user task is saved in the .suo file per user, unlike a TODO, HACK, or UNDONE comment that you type into your source code. A .suo file stores all of a user's solution customizations, which you wouldn't want checked into source control.

VSTip5240

To create a user task, open View–Task List, make sure User Tasks is displayed in the combo box drop-down list, and then click the Create User Task button on the toolbar. Note that you can create the first task by directly editing the first row in the task list, but after that you need to press the button.

Then, as you finish your task, you can check the check box next to it to scratch it off.

VSTip5240a

And to delete a task, simply right-click it and choose Delete.

VSTip5240b

Happy Programming! =)
Posted by Nils-Holger at 12:09 PM with 0 comments.

Thursday, May 8, 2014

Tip 5.23: You can create new Toolbox tabs

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can create your own Toolbox tabs to store practically whatever you want in them. For that upcoming presentation, you can create your own tab by choosing the Add tab on the Toolbox context menu and adding content by using either the mouse or keyboard to populate content into your new tab. (Yes, the keyboard works too for cutting and pasting code from the editor into the Toolbox.)

VSTip5230

Sara Aside

She was going to create another tip called "Did you know you can move tabs?" but it doesn't really stand on its own as a separate tip. As she's writing this, she still has three hours of battery life left for her plane flight, and the plane attendant people (she can't spell what they are called, and her row-seat neighbors are tired of playing human dictionary for her) just served brownies.


You can drag and drop Toolbox tabs to new locations in the list, and their location will persist.

VSTip5230a

Happy Programming! =)
Posted by Nils-Holger at 12:20 PM with 640 comments.

Wednesday, May 7, 2014

Tip 5.22: You can use Ctrl+C to copy controls in a Toolbox tab and then use Ctrl+V to paste the controls into another Toolbox tab

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can use the mouse to drag and drop controls to a new tab, and you can even use Ctrl+Drag to copy controls to a new tab. But did you know you can use the keyboard to achieve the same functionality?

Use the classic Ctrl+C to copy any Toolbox control, and use the classic Ctrl+V to paste into the desired tab location.

VSTip5220

Note how the preceding image illustrates having both code and a button control within the General tab. Also note that she has the Show All option enabled to show the disabled code because when she took this screen shot, the WinForms designer was the active document in the IDE.

Happy Programming! =)
Posted by Nils-Holger at 12:22 PM with 635 comments.

Tuesday, May 6, 2014

Tip 5.21: You can use Show All to find your hiding Toolbox controls

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

This tip comes directly from the developer who works on the Toolbox. He told her her sees a lot of questions where people are trying to figure out why a particular control isn't there, especially when they've just recently added controls.


What happens is that all the controls in the Toolbox are managed by the active designer. A designer is like an editor because it takes up the same region of space in the IDE, but it allows you to design UI rather than write code. You can recognize a designer by the [Design] in the file tab. So, if the currently active designer doesn't support a particular control, you won't see it when you add it to the Toolbox.

VSTip5210

By choosing Show All, you can at least verify that your control was added. Now, how to get it active depends on the control and which designer is needed. In the next screen shot, notice the scroll bar position on the right, showing just how many controls are now visible.

VSTip5210a

Happy Programming! =)
Posted by Nils-Holger at 12:26 PM with 443 comments.

Monday, May 5, 2014

Tip 5.20: You can switch between the Icon view and List Item view in the Toolbox

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Here's yet another action she had no idea you could use until someone showed it to her. By having just the Icon view open, you can save a lot of space within the Toolbox. For each Toolbox grouping, you can customize whether to show the flat list of controls and their names or just show their icons. Right-click anywhere in the desired group, and toggle off List View.

VSTip5200

Here's the Icon view that appears instead of the List View.

VSTip5200a

Happy Programming! =)
Posted by Nils-Holger at 12:45 PM with 433 comments.

Sunday, May 4, 2014

Tip 5.19: You can sort items in the Toolbox alphabetically

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Most of the time, the controls are listed in alphabetical order. But if you ever need to do a reset, you can bring up the Toolbox context menu and select Sort Items Alphabetically.

VSTip5190

Happy Programming! =)
Posted by Nils-Holger at 11:54 AM with 443 comments.

Saturday, May 3, 2014

Tip 5.18: You can use Ctrl+Up Arrow and Ctrl+Down Arrow to move among the various control groups in the Toolbox

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You could page up and down throughout the Toolbox to reach the previous or next control group, or you could just use Ctrl+Up Arrow or Ctrl+Down Arrow.

VSTip5180

Happy Programming! =)
Posted by Nils-Holger at 11:59 AM with 714 comments.

Friday, May 2, 2014

Tip 5.17: You can use * to expand all and / to collapse all in the Toolbox

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

These keystrokes are not actually specific to the Toolbox, as they work for any standard TreeView control. She just calls them out in the Toolbox because this is where she first discovered the * (asterisk) and / (forward slash) in her test-case repository.


Typing * expands everything in the Toolbox. Typing / collapses everything. (Just type the / key; do not use Shift+/ because that will produce a ?.)

Note that the * really does expand all items, including subnodes. In other words, she must warn you: do not, and she really means do not, try to do this at your root c:\ directory. If you do, you'll get to watch Windows Explorer expand every single folder on your machine, which may take a while.

You can also consider using + (plus sign) and - (hyphen), which work for all standard TreeView controls without expanding all or collapsing all. She just tends to use the standard Right Arrow key to expand and Left Arrow key to collapse so that she don't have to reach as far.

To recap, typing * or + or pressing the Right Arrow key expands the tab.

VSTip5170

And pressing / or - or pressing the Left Arrow key collapses the tab.

VSTip5170a

Happy Programming! =)
Posted by Nils-Holger at 11:34 AM with 442 comments.

Thursday, May 1, 2014

Tip 5.16: How to stop the Toolbox from autopopulating with items found in the solution

"Visual Studio Tip, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

The idea for this tip came from a blog reader. She'll admit that she didn't know how to keep the Toolbox from autopopulating. Fortunately, she can ask the developer on the feature directly and share the answer with everyone.


If you have a solution with lots of projects in it, and you notice the Toolbox is taking a long time scanning the solution for all possible Toolbox items, you can go to Tools–Options–Windows Forms Designer–General and set AutoToolboxPopulate to False.

VSTip5160

Happy Programming! =)
Posted by Nils-Holger at 11:57 AM with 435 comments.

Wednesday, April 30, 2014

Tip 5.15: Why does each Toolbox group have a Pointer control?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You've probably noticed how the Pointer control appears at the top of each tab group. This is because whenever a control is selected in the Toolbox, the mouse pointer automatically becomes a drag pointer for that control, meaning that you just have to put your mouse pointer onto the form and click, and the control is dropped. You don't have to hold down any keys to do the actual drag.

But you may not actually want to use the drop function at this time. You can put the focus on the Pointer control to ensure that you don't accidentally drop the item.

VSTip5150

Happy Programming! =)
Posted by Nils-Holger at 11:57 AM with 508 comments.

Tuesday, April 29, 2014

Tip 5.14: You can drag and drop code onto the Toolbox's General tab

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



This tip is especially helpful if you are going to write code in a presentation. Instead of having to type code in front of everyone, you can have it all typed up on the side, ready to go! You've probably noticed the Toolbox General tab showing this information by default.

VSTip5140

Probably one of the best-kept secrets is that you can actually drag and drop code onto the Toolbox. Just highlight some text and then Click+Drag and that text into the General tab. You'll see the following:

VSTip5140a

But it gets better. You can actually drag code to any tab on the Toolbox, including user-created tabs. Note that you may need to select Show All on the Toolbox context menu to display additional tabs so that you can drag the code onto the tab. But after that, the tab will appear whenever you can insert code.

VSTip5140b

Happy Programming! =)
Posted by Nils-Holger at 1:10 PM with 779 comments.

Monday, April 28, 2014

Tip 5.13: You cannot enable Stop Search on the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

You may have noticed the Stop Search command on the Output window context menu. She spent a good 20 minutes trying to figure out how to enable this command before she broke down and e-mailed the developer.


VSTip5130

Apparently, you can't enable it. It's because the Output window and the Find Results window share a lot of implementation, and it should have been hidden for the Output window case.

Happy Programming! =)
Posted by Nils-Holger at 12:03 PM with 695 comments.

Sunday, April 27, 2014

Tip 5.12: You can redirect debug messages to the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Depending on your environment settings, such as the Visual Basic Development Settings, you may have noticed that the Output window's debug content is redirected to the Immediate Window instead. Or maybe you want the Output window's debug content to go to the Immediate Window.

Go to the Tools–Options–Debugging–General page. On this page, you'll find the option Redirect All Output Window Text To The Immediate Window.

VSTip5120

To illustrate, let's say you have this option enabled and you hit an assert. You'll see the assert information in the Immediate Window and not in the Output window.

VSTip5120a

Happy Programming! =)
Posted by Nils-Holger at 11:51 AM with 438 comments.

Saturday, April 26, 2014

Tip 5.11: You can customize the color scheme in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Tools–Options–Environment–Fonts And Colors page, in the Show Settings For combo box, there's an Output Window option. When it's selected, you'll be able to customize the colors for the following types of text: Plain Text, Selected Text, and Inactive Selected Text. Additionally, you can customize the color of the Current List Location.

VSTip5110

If you set the Item Background to Black and the Item Foreground to White, the Output window displays the visited line in the new color scheme.

VSTip5110a

Sara Aside

For her, the dark blue has always been a bit distracting because it makes her think that the focus is in the Output window when it really is in the editor. Another good combination is to change Item Foreground to Cyan and Item Background to White.


Happy Programming! =)
Posted by Nils-Holger at 11:45 AM with 439 comments.

Friday, April 25, 2014

Tip 5.10: You can enable word wrap in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The Output window has an icon on the toolbar that allows you to enable word wrap.

Sara Aside

She doesn't use word wrap, as she prefers one line per error. But she see the potential if you have customized the Output window for space and need to read the entire line without having to scroll left or right.
Here is the Output window before pressing the Toggle Word Wrap button.

VSTip5100

Here is the Output window after pressing the Toggle Word Wrap button.

VSTip5100a

Happy Programming! =)
Posted by Nils-Holger at 11:43 AM with 443 comments.

Thursday, April 24, 2014

Tip 5.9: How to stop the Output window from showing itself during a build

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



At some point, you'll experience the Output window sliding out from its autohiding place during a build. If you want to fine-tune this experience so that the Output window shows only when you tell it to (maybe you just want to check the status bar for the build status or have the Error List pop up if errors occur), go to Tools–Options–Projects And Solutions–General. Check the option called Show Output Window When Build Starts.



Now the Output window will be displayed whenever a build is started.



Happy Programming! =)
Posted by Nils-Holger at 12:40 PM with 436 comments.

Wednesday, April 23, 2014

Tip 5.8: You can use the keyboard to jump to various panes within the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The Output window has a Show Output From drop-down list, as shown in the following screen shot, to move between various outputs views (or panes), such as Debug and Build. There's a command called Window.NextSubPane that navigates to the next output pane.



The command in itself isn't that interesting, but you can bind it to a keyboard shortcut—for example, Ctrl+Shift+Alt+O, since Ctrl+Alt+O is the keyboard shortcut to use for the Output window under the General Development Settings.



Happy Programming! =)
Posted by Nils-Holger at 12:13 PM with 441 comments.

Tuesday, April 22, 2014

Tip 5.7: You can double-click messages in the Output window to jump to that location in the code

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



If you double-click any error or warning in the Output window, you jump directly to that location in the file or to the closest equivalent location.

There's also a button on the Output window toolbar that allows you to do the same thing, just in case you ever wondered what this Find Message In Code button did.



Happy Programming! =)
Posted by Nils-Holger at 12:04 PM with 446 comments.

Monday, April 21, 2014

Tip 5.6: You can use F8 and Shift+F8 to navigate among errors in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



F8 and Shift+F8 are bound to the commands Edit.GoToNextLocation and Edit. GoToPreviousLocation. If you have the Error List open, F8 and Shift+F8 take you directly to the error in question by highlighting that part of the code. If you have the Output window open, F8 and Shift+F8 put the cursor on each error listed.



Happy Programming! =)
Posted by Nils-Holger at 11:26 AM with 445 comments.

Sunday, April 20, 2014

Tip 5.5: How to create a command alias

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



To create an alias, open the Command Window and type alias ha Help.About.



Now typing ha in the Command Window pops open the Help–About menu. But let's explore a more practical application. Consider creating the alias se for Solution Explorer, as shown here:

>alias se View.SolutionExplorer The idea for this example is that while you are coding in the editor, you can press Ctrl+/ to jump to the Find window and type se. Actually, you've probably already used one of the predefined aliases before. The command Debug.Print is alias to ?. To see the full list of aliases, type alias.



Finally, to reset your Command Window aliases back to defaults, type alias /reset.



Or you can simply use the /delete switch to delete a particular alias—for example, type alias se /delete to delete that se alias.

Happy Programming! =)
Posted by Nils-Holger at 11:47 AM with 443 comments.

Saturday, April 19, 2014

Tip 5.4: How to run external executables from the Command Window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The command Tools.Shell runs an external executable out of process from Visual Studio—for example, Shell .

But of course, there are optional arguments. Following are examples of optional arguments for the Tools.Shell command:

Shell [/commandwindow] [/dir:folder] [/outputwindow] [/args]
  • /commandwindow ( or /c) Use this command to display the executable's output in the Command Window.
  • /dir:folder Use this command to specify the working directory.
  • /outputwindow (or /o) Use this command to display the executable's output in the Output window.


For example, Shell /o xcopy.exe c:\users\nils-holger\documents\cmdwinlog.txt c:\users\nils-holger\logfiles displays the xcopy output in the Output window.



Happy Programming! =)
Posted by Nils-Holger at 12:22 PM with 429 comments.

Friday, April 18, 2014

Tip 5.3: How to log your Command Window session

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can record your Command Window session via the log command. Type log -on to start recording. To finish logging, type log -off.

There is also an option to overwrite the existing file; if you don't choose this option, the log command appends the text by default.



Happy Programming! =)
Posted by Nils-Holger at 1:48 PM with 433 comments.

Thursday, April 17, 2014

Tip 5.2: How to search from the Command Window

Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Almost all Visual Studio commands can be run via the Command Window, scope willing. The next screen shot shows what the UI looks like when you type in the Edit.Find command via the Command Window.



Here are the additional Command Window options:

  • >Edit.Find /options Shows which options are currently set
  • >Edit.Find /reset Clears all options
Examples of such commands include the following:
  • >Edit.Find MainForm /case /proc This is a Quick Find command that matches case in the current procedure.
  • >Edit.Find MainForm /o /w /m /u /h This is a Quick Find command that opens documents, matches a whole word, marks matches, searches up, and searches hidden regions, respectively.
  • >Edit.Replace Class1 Class2 /doc /all This is a Quick Replace command that replaces all occurrences of Class1 with Class2 in the current document.
  • >Edit.FindInFiles Program /lookin:"c:\Users\nils-holger\Documents\Visual Studio 2008\Projects" /ext:*.cs /text2 This is a Find In Files command that looks in the Projects folder for files with the .cs extension and shows results in the Find Results 2 window.


Happy Programming! =)
Posted by Nils-Holger at 12:12 PM with 442 comments.

Wednesday, April 16, 2014

Tip 5.1: You can run Visual Studio commands from the Command Window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Press Ctrl+Alt+A to open the Command Window, or go to View–Other Windows–Command Window. Now you can run various Visual Studio commands without having to go through the menus.

Examples of such commands include the following:
  • >File.Open c:\samples\myFile.txt Opens a file without going through the menu
  • >Help vs.commandwindow Opens a Help topic directly
  • >? i Returns the contents of the variable i
  • >? i = 10 Sets the contents of the variable i


For more commonly used commands that take arguments for Visual Studio 2012, check out the following documentation:http://msdn.microsoft.com/en-us/library/c338aexd(v=vs.110).aspx Autocompletion is also provided for both the commands



and their corresponding arguments.



Happy Programming! =)
Posted by Nils-Holger at 12:01 PM with 688 comments.

Tuesday, April 8, 2014

Tip 4.34: How to quickly access Full Screen mode

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can quickly toggle into Full Screen mode from any of the other three window layouts by pressing Shift+Alt+Enter.



Any window customizations you make in Full Screen mode persist across different window layouts (meaning when you are in design mode and go back to Full Screen mode, you'll see the tool windows where you last had them in Full Screen mode) and across different Visual Studio instances (where you close and reopen the IDE).

Happy Programming! =)
Posted by Nils-Holger at 1:10 PM with 442 comments.

Monday, April 7, 2014

Tip 4.33: You can export just your window layouts

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can save all four window layout states at any time by going to the Tools–Import And Export Settings dialog box and choosing the Export option. On the Export page, check the General Settings box and then check the Window Layouts category.



Happy Programming! =)
Posted by Nils-Holger at 12:46 PM with 433 comments.

Sunday, April 6, 2014

Tip 4.32: You can use Shift+Esc to close a tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



As she has said time and time again on her blog, it's really the simple things in life.... she keeps forgetting about this tip, until she sees this keyboard shortcut and has to look up what it does.

Use Shift+Esc to close the currently selected tool window. If the focus is not on a tool window but in an editor, and you press Shift+Esc, Visual Studio will just look at you.



Happy Programming! =)
Posted by Nils-Holger at 2:24 PM with 445 comments.

Saturday, April 5, 2014

Tip 4.31: How to access a toolbar within a tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You may have noticed that within tool windows such as the Solution Explorer, you cannot reach the toolbar by hitting Tab or using the arrow keys. The keyboard shortcut to reach a tool window's toolbar is Shift+Alt. Note that Alt+Shift will not work.



Happy Programming! =)
Posted by Nils-Holger at 1:34 PM with 440 comments.

Friday, April 4, 2014

Tip 4.30: How to resize a tool window from the keyboard

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



  1. Press Alt once.
  2. Press the Spacebar once. You will get the standard window system menu with Move and Size.
  3. Select Size.
  4. Press the arrow keys toward the window edge you want to resize, and resize from there.
  5. Press Enter to commit to the resizing, or press Esc to cancel the resize changes.


Note

Using the Move command from this menu prevents the docking targets from appearing. This is the same as pressing Ctrl and dragging an item using the mouse. If you want to use docking targets via the keyboard, see Tip 4.29.


If you press Alt+Spacebar, you get the main Visual Studio window system menu; this is why you must release the Alt key before you press the Spacebar.

Happy Programming! =)
Posted by Nils-Holger at 12:36 PM with 444 comments.

Thursday, April 3, 2014

Tip 4.29: How to drag a tool window around using the keyboard

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



With the desired tool window selected, press Alt+Minus to bring up the tool window menu. Press the Down Arrow to select the Move command, and press Enter. Now you can control the tool window with the arrow keys.



To dock, simply use the arrow keys to get to the desired dock target and hit Enter to commit to docking the tool window to the new location.

Happy Programming! =)
Posted by Nils-Holger at 12:55 PM with 441 comments.

Wednesday, April 2, 2014

Tip 4.28: How to customize what clicking the X button does to a tool window or tool window tab group

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Tools–Options–Environment–General page, you'll find the Close Button Affects Active Tool Window Only check box. The following screen shot shows a snapshot of two tool window tabs docked together, with the close button circled.



If you want only Solution Explorer to close when pressing the X button, enable the option. Otherwise, both tool windows will close.

Happy Programming! =)
Posted by Nils-Holger at 1:06 PM with 444 comments.

Tuesday, April 1, 2014

Tip 4.27: How to use Ctrl+Page Up and Ctrl+Page Down to navigate among all the tool windows in a tool window group

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Whenever tool window tabs are docked together, they form a little group that you can move around and such, as you've seen in previous tips.



You can use Ctrl+Page Up and Ctrl+Page Down to navigate among the tool windows in this group.

Happy Programming! =)
Posted by Nils-Holger at 1:37 PM with 678 comments.

Monday, March 31, 2014

Tip 4.26: You can use Alt+F6 and Alt+Shift+F6 to cycle through opened tool windows

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of "Sara Ford"

Sara Ford's Blog



If you don't want the IDE Navigator to appear when you navigate among various opened tool windows, use Alt+F6 and Alt+Shift+F6 to go to the next and previous tool windows, respectively, in most-recently used sort order.



Happy Programming! =)
Posted by Nils-Holger at 1:05 PM with 492 comments.

Sunday, March 30, 2014

Tip 4.25: You can use Alt+F7 and Alt+Shift+F7 to move to the next and previous tool windows

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The tool windows you open and visit are saved in an MRU (most-recently used) list. So you can navigate among all the various opened tool windows, using Alt+F7 for next and Alt+Shift+F7 for previous.



Happy Programming! =)
Posted by Nils-Holger at 12:42 PM with 450 comments.

Saturday, March 29, 2014

Tip 4.24: How to use Tabbed Document to maximize a tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog





Yet another one of those "Wow, she didn't know you could do that until someone showed her" moments happened when she found out you can maximize a tool window by setting it to a tabbed document state. With your desired tool window selected, either right-click the tool window title bar or tab window to bring up the tool window context menu and then select Dock as Tabbed Document. Alternatively, you can go to the Window menu and select Tabbed Document.



Happy Programming! =)
Posted by Nils-Holger at 1:32 PM with 446 comments.

Friday, March 28, 2014

Tip 4.23: Why would you want to make a tool window float?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog

Recall from earlier in this chapter how tool windows are available in five different states:
  • Floating
  • Dockable
  • Tabbed document
  • Auto Hide
  • Hide
She would say that the dockable state actually represents two mutually exclusive positions the tool window can be in:
  • Docked The tool window is locked to a specific location, usually to the side of the IDE.
  • Hovering This is her made-up term to describe a tool window that is in the dockable state but is not docked. Recall that the dockable state is different from a floating state, because the floating state cannot be docked.
Most of these states are self-explanatory, especially after a little bit of trial and error, but the floating state may be less obvious. In a floating state, the tool window hovers over the IDE but cannot be docked to a fixed position in the IDE.



How is this useful? Sometimes you just want to position a tool window in a certain area and, unfortunately, the dock targets appear. If you set it to Floating, you never get docking targets for the tool window. (See Tip 4.13.)

Happy Programming! =)
Posted by Nils-Holger at 2:07 PM with 645 comments.

Thursday, March 27, 2014

Tip 4.22: You can speed up or slow down how fast a tool window slides out from a docked position

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Tools–Options–Environment–General page, you'll find the Animate Environment Tools check box. This option controls the speed at which a tool window slides in and out of an autohide state.



Additionally, you can opt out completely from the animation effect by unchecking the Animate Environment Tools check box. If you do that, tool windows pop to their new locations rather than sliding to them.

Happy Programming! =)
Posted by Nils-Holger at 1:51 PM with 436 comments.

Wednesday, March 26, 2014

Tip 4.21: You can use Shift+Click to automatically dock an autohiding tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

She thought she had discovered a bug where "Shift+clicking a tool window that is docked at the bottom of the IDE causes the window to disappear instead of docking." But after repro-ing on someone else's machine (it is so important to get a repro on another machine when you are not sure), she realized that it occurred anywhere. Then she realized what the "bug" was.... If the tool window is still sliding out, it will dock. But if the tool window hasn't started to slide out yet, Shift+Click will perform a Hide command. So this tip is based on both behaviors.
Let's start with "Tool Window 101" training. When a tool window is docked (as discussed in Tip 4.13), you have the option to autohide. Just click the autohide push pin as shown in the following image. Or go to the Window menu and choose Auto Hide to autohide the currently selected tool window.



Clicking this push pin causes the window to autohide, as shown here:



You can mouse over the Solution Explorer and click the push pin again to redock. Or you can go to the Window menu and choose Auto Hide, which unchecks the Auto Hide setting. But what's the fun in that? Now for the actual tip. Did you know that you can press Shift+Click on the autohiding tool window (the second picture in this tip) to move it into a docked state? However, if the tool window is already sliding out (as shown in the next screen shot), it is automatically hidden.



So you are probably wondering, "Okay Sara, so what is Shift+Click really supposed to do?" It is supposed to perform a Window.Hide command. But when the tool window starts to slide, stuff happens in the IDE and it goes into a docked state instead of a hide state. More than you ever wanted to know about the Visual Studio environment, huh?

Happy Programming! =)
Posted by Nils-Holger at 2:38 PM with 446 comments.

Tuesday, March 25, 2014

Tip 4.20: You can double-click the tool window title bar to redock the tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



After you drag a tool window to an undocked position, you can quickly redock the tool window to the previous location by double-clicking the title bar.



Also, you may notice some tool windows are in tool window groups (as shown in the following image), whereas others are docked individually. To separate a tool window from its group, either drag away or double-click the tool window tab, as shown in the following screen shot.



Happy Programming! =)
Posted by Nils-Holger at 1:41 PM with 438 comments.

Monday, March 24, 2014

Tip 4.19: You can show autohiding tool windows via the tool window autohide channel

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



This is one of those features she always forgets. The window management developer and she were discussing another tip, when he showed her the autohide channel context menu.

Right-click the tool window autohide channel to invoke the context menu, and click one of the tool windows to slide it out from hiding.

Note in the picture that the Solution Explorer and Class View tabs are side by side, whereas the Properties tab has some space separating it from the other tabs. This is because Solution Explorer and Class View are docked together and the Properties browser is docked next to it, along the edge.



Happy Programming! =)
Posted by Nils-Holger at 2:34 PM with 442 comments.

Sunday, March 23, 2014

Tip 4.18: You can customize how pressing a tool window push pin autohides the tool window or tool window tab group

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Tools–Options–Environment–General page, you'll find the Auto Hide Button Affects Active Tool Window Only option. The next illustration is a snapshot of two tool windows docked together with the Auto Hide push pin circled.



If you want autohide to apply only to Solution Explorer when you click the push pin, enable the option. Otherwise, autohide will apply to both tool windows.

Happy Programming! =)
Posted by Nils-Holger at 2:20 PM with 448 comments.

Saturday, March 22, 2014

Tip 4.17: You can autohide all of your tool windows with one command

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Window menu, there's the Auto Hide All command. Your environment can go from looking like the following screen shot, with lots and lots of tool windows open:



to looking like this screen shot:



However, there is one caveat: there isn't a command to slide out all of your tool windows.

Happy Programming! =)
Posted by Nils-Holger at 3:59 PM with 1862 comments.

Friday, March 21, 2014

Tip 4.16: You can use docking targets to dock tool windows in new and crazy ways

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

Docking targets are hands-down her all-time favorite feature that she tested. Oh, the fun she would have opening bugs like "Tool Window client area resizes to a negative size after redocking to same location 100-plus times." (Yes, the bug was fixed.)


When you drag a tool window over a docking target, you'll get a preview, as you see in the next screen shot.



But, let's have a little fun ... She has no idea how the tool window tab group shown next could be useful, but maybe if it were resized to fit a secondary monitor ...



Can you tell she enjoyed being a tester?

Happy Programming! =)
Posted by Nils-Holger at 1:18 PM with 445 comments.

Thursday, March 20, 2014

Tip 4.15: You can dock a tool window to the top of the IDE

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



She implied this possibility existed in a previous tip when she introduced all the various IDE docking targets (see Tip 4.13). But she wanted to call it out specifically since it is rare to see a tool window in this position.



The Memory tool windows (when you're in debugging mode) are the only ones that come to mind right now. But there's nothing preventing you from docking your own tool windows up there, as illustrated with the Solution Explorer in the preceding screen shot.

Happy Programming! =)
Posted by Nils-Holger at 1:25 PM with 441 comments.

Wednesday, March 19, 2014

Tip 4.14: How to undock only a single tool window from a group

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can always undock a single tool window by dragging its tool window tab.



Happy Programming! =)
Posted by Nils-Holger at 1:29 PM with 3 comments.

Tuesday, March 18, 2014

Tip 4.13: You can choose from nine IDE tool window docking targets

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



When a tool window is in a dockable state, a set of docking targets appears when you move a tool window to a specific location, such as hovering it over another tool window. But did you know that there are nine IDE docking targets? These docking targets allow you to pin tool windows to the inner and outer parts of the IDE itself.



Docking target 1 puts a tool window into a tabbed document state, docking target 3 docks a tool window to the inner right edge, and docking target 7 docks a tool window to the outer right edge.

If there's no tool window docked on the right, targets 7 and 3 seem to be the same. But if you dock tool window A using target 7 and then dock tool window B using target 3, you get tool window A on the outside and tool window B docked to the left side of tool window A.

You have no idea how crazy it was to test all of these combinations! But she loved it nonetheless.

Happy Programming! =)
Posted by Nils-Holger at 1:18 PM with 438 comments.

Wednesday, September 25, 2013

Tip 5.51: You can use the View.Forward (Alt+Right Arrow) and View.Backward (Alt+Left Arrow) global commands in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



In Tip 5.36, she discussed how you can navigate forward and backward with the Alt+Minus and Shift+Alt+Minus keyboard shortcuts, which are scoped specifically to the Object Browser. But there are two other commands, View.Forward and View.Backward, that also work in the Object Browser, just like Alt+Minus and Shift+Alt+Minus.

View.Forward and View.Backward are global, meaning that other features within the IDE can use them. For example, Class View uses them in the same way as the Object Browser. But you're probably most familiar with these commands as Web Browser Forward and Web Browser Backward. If you are accustomed to using these commands elsewhere in the IDE, you'll feel right at home in the Object Browser.

VSTip5510

Happy Programming! =)
Posted by Nils-Holger at 12:44 PM with 684 comments.

Tuesday, September 24, 2013

Tip 5.50: Why the Object Browser has so many commands you can bind to (and how to create a keyboard shortcut to clear the search results)

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

As she has been writing the Object Browser tip series, she has noticed that there are a lot of commands available under Tools–Options–Environment–Keyboard. Just type ObjectBrowser and you'll see what she means.


VSTip5500

Technically, not all these commands need keyboard shortcuts. For example, the ability to sort objects by access level probably doesn't need a keyboard shortcut. But since they do have shortcuts, let's have some fun.... If you bind any of the Object Browser Settings options to a keyboard shortcut, you'll see that shortcut in the drop-down menu. She didn't know that until she started playing with this feature.

VSTip5500a

How can you take advantage of this? If you use the Object Browser a lot to search, you might find it meaningful to clear the search via the keyboard shortcut. The command View. ObjectBrowserClearSearch clears the search combo, thus clearing the Object Browser filter.

Happy Programming! =)
Posted by Nils-Holger at 12:34 PM with 434 comments.

Monday, September 23, 2013

Tip 5.49: You can export all your Object Browser customizations in a .vssettings file

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio" courtesy of 'Sara Ford'

Sara Ford's Blog



Over these past several tips, we've taken a close look at customizing your Object Browser experience, from sorting to searching to filtering, among other options. Your customizations can be saved to a .vssettings file via the Tools–Import And Export Settings dialog page, under General Settings–Object Browser Options.

VSTip5490

The good news is that the XML stored in the created .vssettings file for the Object Browser Settings is human readable, in case you need to make a quick tweak.

Happy Programming!
Posted by Nils-Holger at 12:34 PM with 627 comments.

Sunday, September 22, 2013

Tip 5.48: How to use type-ahead selection support in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You may have tried this tip on your own, just hoping it would work. But in case you never thought about it, the Object Browser supports type-ahead selection.

VSTip5480

Sara Aside

Back in the Visual Studio .NET 2003 days, she was on a quest for a while to have all lists in the IDE support type-ahead selection. She did what she could, so if you see a list that should support it and it doesn't, definitely file a bug with the Visual Studio Team. Maybe one day her quest will be completed.


Happy Programming!
Posted by Nils-Holger at 11:50 AM with 438 comments.

Saturday, September 21, 2013

Tip 5.47: You can use a Find Symbol search (Shift+F12) in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Just like the previous tip that talked about going to an object's or function's definition, you can find all the references of what you have selected in the Object Browser.



The command Edit.FindAllReferences is bound to Shift+F12. When you press Shift+F12, it brings up the Find All References window.



This is the same as using Find Symbol in the Find In Files window.

Happy Programming! =)
Posted by Nils-Holger at 2:45 PM with 442 comments.

Friday, September 20, 2013

Tip 5.46: You can use F12 in the Object Browser to go to the definition of whatever is selected

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the context menu of both the Member pane (right panel) and the Object pane (left panel), you'll see the Go To Definition command. You can use this command to navigate directly into the code where whatever you have selected is defined (or you'll get a nice error message).

VSTip5460

The Edit.GoToDefinition command is bound to F12. Pressing F12 in the image just shown takes you to where Create() is defined in the code.

Happy Programming! =)
Posted by Nils-Holger at 12:26 PM with 477 comments.

Thursday, September 19, 2013

Tip 5.45: What are the two primary means of searching for objects in the Object Browser?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Now we'll move to the second toolbar in the Object Browser, which is all about searching.

VSTip5450

The search scope depends on what you have selected in the Object Browser Scope. For example, if you try to search for System.Web in a Console Application, you will not be very successful. There's also another way to search—it's using the Find And Replace window's Find Symbol functionality. You'll notice the Find Symbol search closely resembles the Object Browser search functionality.

VSTip5450a

Happy Programming! =)
Posted by Nils-Holger at 12:30 PM with 440 comments.

Wednesday, September 18, 2013

Tip 5.44: You can show extension methods in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



This tip is new for Visual Studio 2008. You can learn more about extension methods in the documentation located at http://msdn.microsoft.com/en-us/library/bb384936.aspx for Visual Basic and http://msdn.microsoft.com/en-us/library/bb383977.aspx for C#.

In Object Browser Settings, you'll see the Show Extension Methods option.

Now, when you have an extension method in your code (in her example, it's a module because she's using Visual Basic), you'll see a downward-pointing arrow.

VSTip5440

Happy Programming! =)
Posted by Nils-Holger at 12:45 PM with 443 comments.

Tuesday, September 17, 2013

Tip 5.43: How to stop displaying all inherited members in the Object Browser Member pane

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The next option in Object Browser Settings is Show Inherited Members. When this option is enabled, you'll see all inherited members, including those inherited from System.Object.

VSTip5430

When this option is disabled, you'll see only Method1(), Method2(), and Method3().

Happy Programming! =)
Posted by Nils-Holger at 1:21 PM with 437 comments.

Monday, September 16, 2013

Tip 5.42: What does Other mean in Show Other Members in Object Browser Settings?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The Other in the Show Other Members option represents members that do not have an access level of public, private, protected, or inherited. For example, access levels of Friend (in Visual Basic) and Internal (C#) fit into this Other category. The Object Browser shows the Friend method with a blue diamond.



Happy Programming! =)
Posted by Nils-Holger at 12:04 PM with 219 comments.

Sunday, September 15, 2013

Tip 5.41: You can mark methods and types as Hidden so that they don't appear in Microsoft IntelliSense or in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio, in ", courtesy of 'Sara Ford'

Sara Ford's Blog



Continuing from Tip 5.40, this tip is how to actually make something hidden or capable of being hidden.

In the System.ComponentModel namespace, there's the EditorBrowseableAttribute class. Going back to the previous tip's Method1() and Method2() methods, you'll see in the following example how Method2() doesn't appear in IntelliSense, just like it doesn't appear in the Object Browser.

VSTip5410

Of course, you can still complete the line just shown with Method2(), and everything will compile successfully.

Happy Programming! =)
Posted by Nils-Holger at 12:48 PM with 549 comments.

Saturday, September 14, 2013

Tip 5.40: You can hide or show hidden members and types in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

She never officially tested the Object Browser but rather played back-up tester in case someone went on vacation, needed help analyzing failures during a full test pass, and so forth. When she wrote most of these tips, she had to browse the test cases and the documentation to make sure she described things consistently and to make sure she was not missing any functionality.


This tip is about the Show Hidden Types And Members option on the Object Browser Settings menu.

VSTip5400

When this option is enabled, any hidden types and members will appear, but they'll appear in a grayed-out state, as shown next in the Method1() and Method2() example, where Method2() is hidden.

VSTip5400a

Happy Programming! =)
Posted by Nils-Holger at 12:32 PM with 0 comments.

Friday, September 13, 2013

Tip 5.39: You can choose whether to show base types in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



In the Object Browser Settings menu, there's the Show Base Types option.

VSTip5390

In the following example, MarathonController inherits from ControllerBase. When this option is enabled, under MarathonController you'll see the Base Types folder. If you've been wondering how to get rid of this (or have been wondering how to enable it), just toggle the setting.

VSTip5390a

Happy Programming! =)
Posted by Nils-Holger at 12:31 PM with 803 comments.

Thursday, September 12, 2013

Tip 5.38: You can customize both your Object pane and Members pane in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Over the next several tips, we're going to take apart the Object Browser Settings menu that lists what appears in the Object Browser.

VSTip5380

The first set of options control your view preference in the Object pane, which is either by namespace or by containers. Think of these two options as a set of radio buttons that are mutually exclusive. The rest of the options are more like check boxes, since you can have all the show options enabled. If you choose View Namespaces (which is the default), all components are shown based on their namespace, just as you would expect. The idea here is that namespaces stored in multiple physical containers are merged, as shown here:

VSTip5380a

Now if you switch to View Containers, you'll see the physical containers, and then a breakdown of the namespaces that are contained in each.

VSTip5380b

Sara Aside

She always uses View Containers so that she doesn't feel so overwhelmed by seeing everything! =)


Happy Programming! =)
Posted by Nils-Holger at 1:20 PM with 0 comments.

Wednesday, September 11, 2013

Tip 5.37: You can create a keyboard shortcut for adding references to a solution from the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

She was kind of surprised to see it in the list of commands. But, then again, one can never have too many keyboard shortcuts. =) To write this tip, she bound it to her pseudo random keyboard shortcut Ctrl+Alt+Shift+T. This is her generic, all-purpose keyboard shortcut that she uses for testing purposes.


As far as binding View.ObjectBrowserAddReference to a keyboard shortcut goes, she'll leave it up to you to decide how useful this is. Maybe the "keyboard shortcut for everything" users will enjoy it. As long as some object has selection—meaning it doesn't have to have focus (blue highlight) and has at least inactive selection (light gray highlight)—in the Objects pane (the leftmost pane), you'll get the following message box when you press the keyboard shortcut.



And if there's nothing selected (meaning you probably have absolutely nothing in the Object Browser) and you press the keyboard shortcut, Visual Studio will just stare at you.

Happy Programming! =)
Posted by Nils-Holger at 12:39 PM with 2475 comments.

Tuesday, September 10, 2013

Tip 5.36: How to use navigate forward and back in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Another set of buttons on the Object Browser toolbar belongs to the Navigate Forward and Navigate Back actions.

VSTip5360

The pages you visit within the Object Browser are saved in MRU (most-recently used) order. This alone is somewhat exciting, but what really makes it exciting is a keyboard shortcut! The commands are View.ObjectBrowserForward and View.ObjectBrowserBack. If you are using the Visual Basic Development Settings, you'll see that the keyboard shortcuts are Alt+Minus for Back and Shift+Alt+Minus for Forward. If you use the Forward and Back functionality frequently and are not using the Visual Basic Settings, go to Tools–Options–Environment–Keyboard, and manually set the keyboard shortcuts there.

Happy Programming! =)
Posted by Nils-Holger at 12:33 PM with 0 comments.

Monday, September 9, 2013

Tip 5.35: You can add references to your solution directly from the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Let's say that you find the component that you want to add to your solution. Typically, you go to Solution Explorer, right-click the project node and select Add References, bring up the Add Reference dialog box, and you know how the rest goes. Within the Object Browser, there's a toolbar button called Add To References located to the right of the "..." browse button and the forward/back navigation buttons. With the Accessibility assembly selected, click the Add To References In Selected Project In Solution Explorer icon to add the assembly.

VSTip5350

And now you'll see the Accessibility assembly added to the project.

VSTip5350a

Happy Programming! =)
Posted by Nils-Holger at 12:42 PM with 642 comments.

Sunday, September 8, 2013

Tip 5.34: You can create a custom list of components for the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can create a custom components list for the Object Browser. There are two ways to reach the Edit Custom Component Set dialog box. Either click that little "..." browse button next to the combo box or click the Edit Custom Component Set option in the Browse combo box.

VSTip5340

Now you'll see the Edit Custom Component Set window, where you can add and remove components. And for old time's sake, she has added an Accessibility assembly.

VSTip5340a

Finally, when returning to the Object Browser, you get the following view.

VSTip5340b

Happy Programming! =)
Posted by Nils-Holger at 12:33 PM with 0 comments.

Saturday, September 7, 2013

Tip 5.33: You can specify to show components in your solution only in the Object Browser

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



By default, the Object Browser shows you all the components in the latest .NET Framework version. But sometimes you don't need to know about the entire world, and you just want to focus on the objects in your solution. In the upper-right corner of the Object Browser, you'll see a Browse combo box. If you drop down the combo box list, you'll see the option for selecting My Solution.

VSTip5330

Happy Programming! =)
Posted by Nils-Holger at 12:46 PM with 841 comments.

Friday, September 6, 2013

Tip 5.32: You can use Ctrl+Alt+J to open the Object Browser window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can use Ctrl+Alt+J to open the Object Browser window. The command is View.ObjectBrowser.

VSTip5320

Happy Programming! =)
Posted by Nils-Holger at 12:52 PM with 438 comments.

Thursday, September 5, 2013

Tip 5.31: You can create keyboard shortcuts to navigate among the various Task List categories (by using View.NextTask and View.PreviousTask)

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



F8 and Shift+F8 are bound to the commands Edit.GoToNextLocation and Edit. GoToPreviousLocation. When the Task List is visible, these keyboard shortcuts navigate throughout all the tasks listed in a given category. However, if you want to navigate at any time among your various TODO comments or other tasks, regardless of whether the Task List is open, the Task List comes with two commands for doing this: View.NextTask and View.PreviousTask. Because we've already explored more than you ever wanted to know about the Task List, you now know that the Task List has several categories: User Tasks, Comments, and Shortcuts. These commands navigate only among items of a given category, so you won't jump from Shortcuts to User Tasks. Note that these commands are not bound to a keyboard shortcut by default in the General Development Settings, so you may need to bind them yourself, depending on your development settings.

VSTip5310

Go to Tools–Options–Environment–Keyboard, and in the Show Commands Containing edit box, type the command View.NextTask. Do a sanity check for whether the settings you are using already have the command bound to a keyboard shortcut. If a command is already bound to a keyboard shortcut, you'll see it in the Shortcut Currently Used By read-only combo box, which you can see in the preceding screen shot. If the command is not bound to a shortcut, in the Press Shortcut Keys edit box, type your preferred shortcut and click Assign. If you want this command to work only in the editor and not anywhere else in the IDE, use the Text Editor scope under the Use New Shortcut In drop-down list. Rinse and repeat for the View.PreviousTask command. For her, she used Ctrl+Alt+N, only because it wasn't bound to anything in the General Development Settings. For the previous action, she highly recommends just adding the Shift key to whatever key combination you come up with for View.NextTask, since the standard convention for any backward navigation is to include Shift. Also, something else to note, because she had to test for it, is that the Visual Studio status bar will update with the name of the comment when you use View.NextTask or View.PreviousTask.

VSTip5310a

Happy Programming! =)
Posted by Nils-Holger at 11:55 AM with 734 comments.

Wednesday, September 4, 2013

Tip 5.30: You can show a full file path in the Task List

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



This tip applies only to comments and shortcuts, as user tasks are not saved with a file. Go to Tools–Options–Environment–Task List, and uncheck the Hide Full File Paths check box.

VSTip5300

And now the Task List displays the full paths for shortcuts.

VSTip5300a

Happy Programming! =)
Posted by Nils-Holger at 12:20 PM with 445 comments.

Tuesday, September 3, 2013

Tip 5.29: How to disable the prompt for deleting the Task List's user tasks

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



If you've created a few tasks and deleted them over time, you may have found that delete confirmation prompt to be annoying. Here's how you can disable it. On each user task, you'll see the Delete command on the context menu, as shown in the following screen shot.

VSTip5290

And when you click it, you'll get this prompt:

VSTip5290a

To disable this prompt, go to Tools–Options–Environment–Task List, and uncheck the Confirm Deletion Of Tasks check box.

VSTip5290b

Happy Programming! =)
Posted by Nils-Holger at 12:58 PM with 436 comments.

Monday, September 2, 2013

Tip 5.28: You can show HACK, UNDONE, and custom tokens in the Task List

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



TODO comments are not the only thing you can display under Comments in the Task List. If you go to Tools–Options–Environment–Task List, you'll see a Token List. By default, the Token List comes with HACK, UNDONE, and TODO, but you can create your own.



Using a user-created TipOfTheDay token, she can type a comment in her code using the //TipOfTheDay token format, as shown here:



The TipOfTheDay comment now appears in the Task List.

VSTip5280b

Happy Programming! =)
Posted by Nils-Holger at 12:33 PM with 724 comments.

Sunday, September 1, 2013

Tip 5.27: You can create shortcuts in your Task List

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

This is yet another feature she didn't know about until someone showed her.


You can store shortcuts in your Task List, and you can even use them as tasks to scratch off, if you want. And just like user tasks, shortcuts are saved in your solution .suo file, so they won't get checked into the source control. To create a Task List shortcut, go to the desired location in your editor (which can be any line of code or comment) and then go to Edit–Bookmarks–Add Task List Shortcut.



Now you'll notice the shortcuts curved-arrow glyph appears in the indicator margin.

VSTip5270a

And now in the Task List, you'll see a new category called Shortcuts.

VSTip5270b

As illustrated in the preceding screen shot, you can also rename these shortcuts by double-clicking the description (or tabbing to the description field, for keyboard users) and then typing a new name.

Sara Aside

You may be wondering what the difference is between bookmarks and Task List shortcuts. At a high level, you won't see much difference. But, at the feature level, Task List shortcuts provide a few differences. Task List shortcuts display the entire line of code in the Task List window. Also, you can set a priority and check off these shortcuts as you complete them.


Happy Programming! =)
Posted by Nils-Holger at 12:32 PM with 436 comments.

Saturday, August 31, 2013

Tip 5.26: How to create and view TODO comments in the Task List

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Let's focus now on the other aspect of the Task List: the comments left in the code. You need to drop down the combo box at the top right to show Comments to be able to see your comment tokens (for example, UNDONE, TODO, and HACKS) in the Task List.



So let's say that you have a TODO comment in your code as shown here.



By going to the Comments view in the Task List, you can now see your TODO comment.



Happy Programming! =)
Posted by Nils-Holger at 1:02 PM with 513 comments.

Friday, August 30, 2013

Tip 5.25: You can assign a priority to your Task List's user tasks

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Now that you've created a user task, you can assign a priority. She calls this out as a separate tip, as it is most likely not intuitive that you can do this. Under the ! (exclamation point) column, you can click any cell to pop open the priority combo box.

VSTip5250

Then you'll be able to view and sort your user tasks based on priority.

VSTip5250a

Happy Programming! =)
Posted by Nils-Holger at 1:02 PM with 1114 comments.

Thursday, August 29, 2013

Tip 5.24: You can use the Task List to create user tasks that are separate from your code

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



A user task is saved in the .suo file per user, unlike a TODO, HACK, or UNDONE comment that you type into your source code. A .suo file stores all of a user's solution customizations, which you wouldn't want checked into source control.

VSTip5240

To create a user task, open View–Task List, make sure User Tasks is displayed in the combo box drop-down list, and then click the Create User Task button on the toolbar. Note that you can create the first task by directly editing the first row in the task list, but after that you need to press the button. Then, as you finish your task, you can check the check box next to it to scratch it off.

VSTip5240a

And to delete a task, simply right-click it and choose Delete.

VSTip5240b

Happy Programming! =)
Posted by Nils-Holger at 12:11 PM with 507 comments.

Wednesday, August 28, 2013

Tip 5.23: You can create new Toolbox tabs

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog

You can create your own Toolbox tabs to store practically whatever you want in them. For that upcoming presentation, you can create your own tab by choosing the Add tab on the Toolbox context menu and adding content by using either the mouse or keyboard to populate content into your new tab. (Yes, the keyboard works too for cutting and pasting code from the editor into the Toolbox.)

VSTip5230

Sara Aside

She was going to create another tip called "Did you know you can move tabs?" but it doesn't really stand on its own as a separate tip. As she's writing this, she still has three hours of battery life left for her plane flight, and the plane attendant people (she can't spell what they are called, and her row-seat neighbors are tired of playing human dictionary for her) just served brownies.
You can drag and drop Toolbox tabs to new locations in the list, and their location will persist.

VSTip5230a

Happy Programming! =)
Posted by Nils-Holger at 12:27 PM with 2539 comments.

Tuesday, August 27, 2013

Tip 5.22: You can use Ctrl+C to copy controls in a Toolbox tab and then use Ctrl+V to paste the controls into another Toolbox tab

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can use the mouse to drag and drop controls to a new tab, and you can even use Ctrl+Drag to copy controls to a new tab. But did you know you can use the keyboard to achieve the same functionality? Use the classic Ctrl+C to copy any Toolbox control, and use the classic Ctrl+V to paste into the desired tab location.

VSTip5220

Note how the preceding image illustrates having both code and a button control within the General tab. Also note that she has the Show All option enabled to show the disabled code because when she took this screen shot, the WinForms designer was the active document in the IDE.

Happy Programming! =)
Posted by Nils-Holger at 11:42 AM with 674 comments.

Monday, August 26, 2013

Tip 5.21: You can use Show All to find your hiding Toolbox controls

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside



This tip comes directly from the developer who works on the Toolbox. He told her her sees a lot of questions where people are trying to figure out why a particular control isn't there, especially when they've just recently added controls.


What happens is that all the controls in the Toolbox are managed by the active designer. A designer is like an editor because it takes up the same region of space in the IDE, but it allows you to design UI rather than write code. You can recognize a designer by the [Design] in the file tab. So, if the currently active designer doesn't support a particular control, you won't see it when you add it to the Toolbox.

VSTip5210

By choosing Show All, you can at least verify that your control was added. Now, how to get it active depends on the control and which designer is needed. In the next screen shot, notice the scroll bar position on the right, showing just how many controls are now visible.

VSTip5210a

Happy Programming! =)
Posted by Nils-Holger at 11:19 AM with 435 comments.

Sunday, August 25, 2013

Tip 5.20: You can switch between the Icon view and List Item view in the Toolbox

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Here's yet another action she had no idea you could use until someone showed it to her. By having just the Icon view open, you can save a lot of space within the Toolbox. For each Toolbox grouping, you can customize whether to show the flat list of controls and their names or just show their icons. Right-click anywhere in the desired group, and toggle off List View.

VSTip5200

Here's the Icon view that appears instead of the List View.

VSTip5200a

Happy Programming! =)
Posted by Nils-Holger at 11:22 AM with 446 comments.

Saturday, August 24, 2013

Tip 5.18: You can use Ctrl+Up Arrow and Ctrl+Down Arrow to move among the various control groups in the Toolbox

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You could page up and down throughout the Toolbox to reach the previous or next control group, or you could just use Ctrl+Up Arrow or Ctrl+Down Arrow.



Happy Programming! =)
Posted by Nils-Holger at 9:17 AM with 704 comments.

Friday, August 23, 2013

Tip 5.17: You can use * to expand all and / to collapse all in the Toolbox

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog

Sara Aside

These keystrokes are not actually specific to the Toolbox, as they work for any standard TreeView control. She just calls them out in the Toolbox because this is where she first discovered the * (asterisk) and / (forward slash) in her test-case repository.


Typing * expands everything in the Toolbox. Typing / collapses everything. (Just type the / key; do not use Shift+/ because that will produce a ?.) Note that the * really does expand all items, including subnodes. In other words, she must warn you: do not, and  she really means do not, try to do this at your root c:\ directory. If you do, you'll get to watch Windows Explorer expand every single folder on your machine, which may take a while. You can also consider using + (plus sign) and - (hyphen), which work for all standard TreeView controls without expanding all or collapsing all. She just tends to use the standard Right Arrow key to expand and Left Arrow key to collapse so that she don't have to reach as far. To recap, typing * or + or pressing the Right Arrow key expands the tab.

VSTip5170 And pressing / or - or pressing the Left Arrow key collapses the tab.

VSTip5170a

Happy Programming! =)
Posted by Nils-Holger at 12:05 PM with 438 comments.

Thursday, August 22, 2013

Tip 5.16: How to stop the Toolbox from autopopulating with items found in the solution

"Visual Studio Tip, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

The idea for this tip came from a blog reader. She'll admit that she didn't know how to keep the Toolbox from autopopulating. Fortunately, she can ask the developer on the feature directly and share the answer with everyone.
If you have a solution with lots of projects in it, and you notice the Toolbox is taking a long time scanning the solution for all possible Toolbox items, you can go to Tools–Options–Windows Forms Designer–General and set AutoToolboxPopulate to False.

VSTip5160

Happy Programming! =)
Posted by Nils-Holger at 12:50 PM with 447 comments.

Wednesday, August 21, 2013

Tip 5.15: Why does each Toolbox group have a Pointer control?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You've probably noticed how the Pointer control appears at the top of each tab group. This is because whenever a control is selected in the Toolbox, the mouse pointer automatically becomes a drag pointer for that control, meaning that you just have to put your mouse pointer onto the form and click, and the control is dropped. You don't have to hold down any keys to do the actual drag. But you may not actually want to use the drop function at this time. You can put the focus on the Pointer control to ensure that you don't accidentally drop the item.

VSTip5150

Happy Programming! =)
Posted by Nils-Holger at 12:42 PM with 752 comments.

Tuesday, August 20, 2013

Tip 5.14: You can drag and drop code onto the Toolbox's General tab

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



This tip is especially helpful if you are going to write code in a presentation. Instead of having to type code in front of everyone, you can have it all typed up on the side, ready to go! You've probably noticed the Toolbox General tab showing this information by default.

VSTip5140

Probably one of the best-kept secrets is that you can actually drag and drop code onto the Toolbox. Just highlight some text and then Click+Drag and that text into the General tab. You'll see the following:

VSTip5140a

But it gets better. You can actually drag code to any tab on the Toolbox, including user-created tabs. Note that you may need to select Show All on the Toolbox context menu to display additional tabs so that you can drag the code onto the tab. But after that, the tab will appear whenever you can insert code.

VSTip5140b

Happy Programming! =)
Posted by Nils-Holger at 12:12 PM with 0 comments.

Monday, August 19, 2013

Tip 5.13: You cannot enable Stop Search on the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

You may have noticed the Stop Search command on the Output window context menu. She spent a good 20 minutes trying to figure out how to enable this command before she broke down and e-mailed the developer.


VSTip5130

Apparently, you can't enable it. It's because the Output window and the Find Results window share a lot of implementation, and it should have been hidden for the Output window case.

Happy Programming! =)
Posted by Nils-Holger at 1:20 PM with 837 comments.

Sunday, August 18, 2013

Tip 5.12: You can redirect debug messages to the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Depending on your environment settings, such as the Visual Basic Development Settings, you may have noticed that the Output window's debug content is redirected to the Immediate Window instead. Or maybe you want the Output window's debug content to go to the Immediate Window. Go to the Tools–Options–Debugging–General page. On this page, you'll find the option Redirect All Output Window Text To The Immediate Window.

VSTip5120

To illustrate, let's say you have this option enabled and you hit an assert. You'll see the assert information in the Immediate Window and not in the Output window.

VSTip5120a

Happy Programming! =)
Posted by Nils-Holger at 12:53 PM with 0 comments.

Saturday, August 17, 2013

Tip 5.11: You can customize the color scheme in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Tools–Options–Environment–Fonts And Colors page, in the Show Settings For combo box, there's an Output Window option. When it's selected, you'll be able to customize the colors for the following types of text: Plain Text, Selected Text, and Inactive Selected Text. Additionally, you can customize the color of the Current List Location.

VSTip5110

If you set the Item Background to Black and the Item Foreground to White, the Output window displays the visited line in the new color scheme.

VSTip5110a

Sara Aside

For her, the dark blue has always been a bit distracting because it makes her think that the focus is in the Output window when it really is in the editor. Another good combination is to change Item Foreground to Cyan and Item Background to White.


Happy Programming! =)
Posted by Nils-Holger at 12:55 PM with 442 comments.

Friday, August 16, 2013

Tip 5.10: You can enable word wrap in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The Output window has an icon on the toolbar that allows you to enable word wrap.

Sara Aside

She doesn't use word wrap, as she prefers one line per error. But she see the potential if you have customized the Output window for space and need to read the entire line without having to scroll left or right.
Here is the Output window before pressing the Toggle Word Wrap button.

VSTip5100

Here is the Output window after pressing the Toggle Word Wrap button.

VSTip5100a

Happy Programming! =)
Posted by Nils-Holger at 1:39 PM with 682 comments.

Thursday, August 15, 2013

Tip 5.9: How to stop the Output window from showing itself during a build

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



At some point, you'll experience the Output window sliding out from its autohiding place during a build. If you want to fine-tune this experience so that the Output window shows only when you tell it to (maybe you just want to check the status bar for the build status or have the Error List pop up if errors occur), go to Tools–Options–Projects And Solutions–General. Check the option called Show Output Window When Build Starts.



Now the Output window will be displayed whenever a build is started.



Happy Programming! =)
Posted by Nils-Holger at 12:55 PM with 440 comments.

Wednesday, August 14, 2013

Tip 5.8: You can use the keyboard to jump to various panes within the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The Output window has a Show Output From drop-down list, as shown in the following screen shot, to move between various outputs views (or panes), such as Debug and Build. There's a command called Window.NextSubPane that navigates to the next output pane.



The command in itself isn't that interesting, but you can bind it to a keyboard shortcut—for example, Ctrl+Shift+Alt+O, since Ctrl+Alt+O is the keyboard shortcut to use for the Output window under the General Development Settings.



Happy Programming! =)
Posted by Nils-Holger at 12:54 PM with 433 comments.

Tuesday, August 13, 2013

Tip 5.7: You can double-click messages in the Output window to jump to that location in the code

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



If you double-click any error or warning in the Output window, you jump directly to that location in the file or to the closest equivalent location. There's also a button on the Output window toolbar that allows you to do the same thing, just in case you ever wondered what this Find Message In Code button did.



Happy Programming! =)
Posted by Nils-Holger at 1:06 PM with 693 comments.

Monday, August 12, 2013

Tip 5.6: You can use F8 and Shift+F8 to navigate among errors in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



F8 and Shift+F8 are bound to the commands Edit.GoToNextLocation and Edit. GoToPreviousLocation. If you have the Error List open, F8 and Shift+F8 take you directly to the error in question by highlighting that part of the code. If you have the Output window open, F8 and Shift+F8 put the cursor on each error listed.



Happy Programming! =)
Posted by Nils-Holger at 1:14 PM with 0 comments.

Sunday, August 11, 2013

Tip 5.5: How to create a command alias

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



To create an alias, open the Command Window and type alias ha Help.About.



Now typing ha in the Command Window pops open the Help–About menu. But let's explore a more practical application. Consider creating the alias se for Solution Explorer, as shown here: >alias se View.SolutionExplorer The idea for this example is that while you are coding in the editor, you can press Ctrl+/ to jump to the Find window and type se. Actually, you've probably already used one of the predefined aliases before. The command Debug.Print is alias to ?. To see the full list of aliases, type alias.



Finally, to reset your Command Window aliases back to defaults, type alias /reset.



Or you can simply use the /delete switch to delete a particular alias—for example, type alias se /delete to delete that se alias.

Happy Programming! =)
Posted by Nils-Holger at 11:48 AM with 436 comments.

Saturday, August 10, 2013

Tip 5.4: How to run external executables from the Command Window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The command Tools.Shell runs an external executable out of process from Visual Studio—for example, Shell . But of course, there are optional arguments. Following are examples of optional arguments for the Tools.Shell command:

Shell [/commandwindow] [/dir:folder] [/outputwindow] [/args]
  • /commandwindow ( or /c) Use this command to display the executable's output in the Command Window.
  • /dir:folder Use this command to specify the working directory.
  • /outputwindow (or /o) Use this command to display the executable's output in the Output window.
For example, Shell /o xcopy.exe c:\users\nils-holger\documents\cmdwinlog.txt c:\users\nils-holger\logfiles displays the xcopy output in the Output window.



Happy Programming! =)
Posted by Nils-Holger at 1:08 PM with 479 comments.

Friday, August 9, 2013

Tip 5.3: How to log your Command Window session

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can record your Command Window session via the log command. Type log -on to start recording. To finish logging, type log -off. There is also an option to overwrite the existing file; if you don't choose this option, the log command appends the text by default.



Happy Programming! =)
Posted by Nils-Holger at 1:20 PM with 434 comments.

Thursday, August 8, 2013

Tip 5.2: How to search from the Command Window

Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Almost all Visual Studio commands can be run via the Command Window, scope willing. The next screen shot shows what the UI looks like when you type in the Edit.Find command via the Command Window.



Here are the additional Command Window options:
  • >Edit.Find /options Shows which options are currently set
  • >Edit.Find /reset Clears all options
Examples of such commands include the following:
  • >Edit.Find MainForm /case /proc This is a Quick Find command that matches case in the current procedure.
  • >Edit.Find MainForm /o /w /m /u /h This is a Quick Find command that opens documents, matches a whole word, marks matches, searches up, and searches hidden regions, respectively.
  • >Edit.Replace Class1 Class2 /doc /all This is a Quick Replace command that replaces all occurrences of Class1 with Class2 in the current document.
  • >Edit.FindInFiles Program /lookin:"c:\Users\nils-holger\Documents\Visual Studio 2008\Projects" /ext:*.cs /text2 This is a Find In Files command that looks in the Projects folder for files with the .cs extension and shows results in the Find Results 2 window.


Happy Programming! =)
Posted by Nils-Holger at 12:56 PM with 682 comments.

Monday, July 29, 2013

Tip 4.33: You can export just your window layouts

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can save all four window layout states at any time by going to the Tools–Import And Export Settings dialog box and choosing the Export option. On the Export page, check the General Settings box and then check the Window Layouts category.



Happy Programming! =)
Posted by Nils-Holger at 1:08 PM with 443 comments.

Sunday, July 28, 2013

Tip 4.32: You can use Shift+Esc to close a tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



As she has said time and time again on her blog, it's really the simple things in life.... she keeps forgetting about this tip, until she sees this keyboard shortcut and has to look up what it does. Use Shift+Esc to close the currently selected tool window. If the focus is not on a tool window but in an editor, and you press Shift+Esc, Visual Studio will just look at you.



Happy Programming! =)
Posted by Nils-Holger at 11:57 AM with 4 comments.

Saturday, July 27, 2013

Tip 4.31: How to access a toolbar within a tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You may have noticed that within tool windows such as the Solution Explorer, you cannot reach the toolbar by hitting Tab or using the arrow keys. The keyboard shortcut to reach a tool window's toolbar is Shift+Alt. Note that Alt+Shift will not work.



Happy Programming! =)
Posted by Nils-Holger at 12:29 PM with 489 comments.

Friday, July 26, 2013

Tip 4.30: How to resize a tool window from the keyboard

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



  1. Press Alt once.
  2. Press the Spacebar once. You will get the standard window system menu with Move and Size.



  3. Select Size.
  4. Press the arrow keys toward the window edge you want to resize, and resize from there.
  5. Press Enter to commit to the resizing, or press Esc to cancel the resize changes.

Note

Using the Move command from this menu prevents the docking targets from appearing. This is the same as pressing Ctrl and dragging an item using the mouse. If you want to use docking targets via the keyboard, see Tip 4.29.


If you press Alt+Spacebar, you get the main Visual Studio window system menu; this is why you must release the Alt key before you press the Spacebar.

Happy Programming! =)
Posted by Nils-Holger at 12:57 PM with 0 comments.

Thursday, July 25, 2013

Tip 4.29: How to drag a tool window around using the keyboard

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



With the desired tool window selected, press Alt+Minus to bring up the tool window menu. Press the Down Arrow to select the Move command, and press Enter. Now you can control the tool window with the arrow keys.



To dock, simply use the arrow keys to get to the desired dock target and hit Enter to commit to docking the tool window to the new location.

Happy Programming! =)
Posted by Nils-Holger at 12:58 PM with 446 comments.

Wednesday, July 24, 2013

Tip 4.28: How to customize what clicking the X button does to a tool window or tool window tab group

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Tools–Options–Environment–General page, you'll find the Close Button Affects Active Tool Window Only check box. The following screen shot shows a snapshot of two tool window tabs docked together, with the close button circled.



If you want only Solution Explorer to close when pressing the X button, enable the option. Otherwise, both tool windows will close.

Happy Programming! =)
Posted by Nils-Holger at 12:53 PM with 439 comments.

Tuesday, July 23, 2013

Tip 4.27: How to use Ctrl+Page Up and Ctrl+Page Down to navigate among all the tool windows in a tool window group

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Whenever tool window tabs are docked together, they form a little group that you can move around and such, as you've seen in previous tips.



You can use Ctrl+Page Up and Ctrl+Page Down to navigate among the tool windows in this group.

Happy Programming! =)
Posted by Nils-Holger at 12:30 PM with 0 comments.

Monday, July 22, 2013

Tip 4.26: You can use Alt+F6 and Alt+Shift+F6 to cycle through opened tool windows

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of "Sara Ford"

Sara Ford's Blog



If you don't want the IDE Navigator to appear when you navigate among various opened tool windows, use Alt+F6 and Alt+Shift+F6 to go to the next and previous tool windows, respectively, in most-recently used sort order.



Happy Programming! =)
Posted by Nils-Holger at 12:55 PM with 443 comments.

Sunday, July 21, 2013

Tip 4.25: You can use Alt+F7 and Alt+Shift+F7 to move to the next and previous tool windows

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The tool windows you open and visit are saved in an MRU (most-recently used) list. So you can navigate among all the various opened tool windows, using Alt+F7 for next and Alt+Shift+F7 for previous.



Happy Programming! =)
Posted by Nils-Holger at 12:07 PM with 441 comments.

Saturday, July 20, 2013

Tip 4.24: How to use Tabbed Document to maximize a tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog





Yet another one of those "Wow, she didn't know you could do that until someone showed her" moments happened when she found out you can maximize a tool window by setting it to a tabbed document state. With your desired tool window selected, either right-click the tool window title bar or tab window to bring up the tool window context menu and then select Dock as Tabbed Document. Alternatively, you can go to the Window menu and select Tabbed Document.



Happy Programming! =)
Posted by Nils-Holger at 12:44 PM with 443 comments.

Friday, July 19, 2013

Tip 4.23: Why would you want to make a tool window float?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Recall from earlier in this chapter how tool windows are available in five different states:
  • Floating
  • Dockable
  • Tabbed document
  • Auto Hide
  • Hide
She would say that the dockable state actually represents two mutually exclusive positions the tool window can be in:
  • Docked The tool window is locked to a specific location, usually to the side of the IDE.
  • Hovering This is her made-up term to describe a tool window that is in the dockable state but is not docked. Recall that the dockable state is different from a floating state, because the floating state cannot be docked.
Most of these states are self-explanatory, especially after a little bit of trial and error, but the floating state may be less obvious. In a floating state, the tool window hovers over the IDE but cannot be docked to a fixed position in the IDE.



How is this useful? Sometimes you just want to position a tool window in a certain area and, unfortunately, the dock targets appear. If you set it to Floating, you never get docking targets for the tool window. (See Tip 4.13.)

Happy Programming! =)
Posted by Nils-Holger at 1:11 PM with 626 comments.

Thursday, July 18, 2013

Tip 4.22: You can speed up or slow down how fast a tool window slides out from a docked position

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Tools–Options–Environment–General page, you'll find the Animate Environment Tools check box. This option controls the speed at which a tool window slides in and out of an autohide state.



Additionally, you can opt out completely from the animation effect by unchecking the Animate Environment Tools check box. If you do that, tool windows pop to their new locations rather than sliding to them.

Happy Programming! =)
Posted by Nils-Holger at 12:15 PM with 435 comments.

Wednesday, July 17, 2013

Tip 4.21: You can use Shift+Click to automatically dock an autohiding tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

She thought she had discovered a bug where "Shift+clicking a tool window that is docked at the bottom of the IDE causes the window to disappear instead of docking." But after repro-ing on someone else's machine (it is so important to get a repro on another machine when you are not sure), she realized that it occurred anywhere. Then she realized what the "bug" was.... If the tool window is still sliding out, it will dock. But if the tool window hasn't started to slide out yet, Shift+Click will perform a Hide command. So this tip is based on both behaviors.
Let's start with "Tool Window 101" training. When a tool window is docked (as discussed in Tip 4.13), you have the option to autohide. Just click the autohide push pin as shown in the following image. Or go to the Window menu and choose Auto Hide to autohide the currently selected tool window.



Clicking this push pin causes the window to autohide, as shown here:



You can mouse over the Solution Explorer and click the push pin again to redock. Or you can go to the Window menu and choose Auto Hide, which unchecks the Auto Hide setting. But what's the fun in that? Now for the actual tip. Did you know that you can press Shift+Click on the autohiding tool window (the second picture in this tip) to move it into a docked state? However, if the tool window is already sliding out (as shown in the next screen shot), it is automatically hidden.



So you are probably wondering, "Okay Sara, so what is Shift+Click really supposed to do?" It is supposed to perform a Window.Hide command. But when the tool window starts to slide, stuff happens in the IDE and it goes into a docked state instead of a hide state. More than you ever wanted to know about the Visual Studio environment, huh? Happy Programming! =)
Posted by Nils-Holger at 12:13 PM with 446 comments.

Tuesday, July 16, 2013

Tip 4.20: You can double-click the tool window title bar to redock the tool window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



After you drag a tool window to an undocked position, you can quickly redock the tool window to the previous location by double-clicking the title bar.



Also, you may notice some tool windows are in tool window groups (as shown in the following image), whereas others are docked individually. To separate a tool window from its group, either drag away or double-click the tool window tab, as shown in the following screen shot.



Happy Programming! =)
Posted by Nils-Holger at 1:20 PM with 440 comments.

Monday, July 15, 2013

Tip 4.19: You can show autohiding tool windows via the tool window autohide channel

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



This is one of those features she always forgets. The window management developer and she were discussing another tip, when he showed her the autohide channel context menu. Right-click the tool window autohide channel to invoke the context menu, and click one of the tool windows to slide it out from hiding. Note in the picture that the Solution Explorer and Class View tabs are side by side, whereas the Properties tab has some space separating it from the other tabs. This is because Solution Explorer and Class View are docked together and the Properties browser is docked next to it, along the edge.



Happy Programming! =)
Posted by Nils-Holger at 12:42 PM with 0 comments.

Sunday, July 14, 2013

Tip 4.18: You can customize how pressing a tool window push pin autohides the tool window or tool window tab group

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Tools–Options–Environment–General page, you'll find the Auto Hide Button Affects Active Tool Window Only option. The next illustration is a snapshot of two tool windows docked together with the Auto Hide push pin circled.



If you want autohide to apply only to Solution Explorer when you click the push pin, enable the option. Otherwise, autohide will apply to both tool windows.

Happy Programming! =)
Posted by Nils-Holger at 12:32 PM with 435 comments.

Saturday, July 13, 2013

Tip 4.17: You can autohide all of your tool windows with one command

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



On the Window menu, there's the Auto Hide All command. Your environment can go from looking like the following screen shot, with lots and lots of tool windows open:



to looking like this screen shot:



However, there is one caveat: there isn't a command to slide out all of your tool windows.

Happy Programming! =)
Posted by Nils-Holger at 12:59 PM with 436 comments.

Friday, July 12, 2013

Tip 4.16: You can use docking targets to dock tool windows in new and crazy ways

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

Docking targets are hands-down her all-time favorite feature that she tested. Oh, the fun she would have opening bugs like "Tool Window client area resizes to a negative size after redocking to same location 100-plus times." (Yes, the bug was fixed.)
When you drag a tool window over a docking target, you'll get a preview, as you see in the next screen shot.



But, let's have a little fun ... She has no idea how the tool window tab group shown next could be useful, but maybe if it were resized to fit a secondary monitor ...



Can you tell she enjoyed being a tester?

Happy Programming! =)
Posted by Nils-Holger at 12:27 PM with 0 comments.

Thursday, July 11, 2013

Tip 4.15: You can dock a tool window to the top of the IDE

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



She implied this possibility existed in a previous tip when she introduced all the various IDE docking targets (see Tip 4.13). But she wanted to call it out specifically since it is rare to see a tool window in this position.



The Memory tool windows (when you're in debugging mode) are the only ones that come to mind right now. But there's nothing preventing you from docking your own tool windows up there, as illustrated with the Solution Explorer in the preceding screen shot.

Happy Programming! =)
Posted by Nils-Holger at 12:36 PM with 444 comments.

Wednesday, July 10, 2013

Tip 4.14: How to undock only a single tool window from a group

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



You can always undock a single tool window by dragging its tool window tab.



Happy Programming! =)
Posted by Nils-Holger at 12:58 PM with 674 comments.

Tuesday, July 9, 2013

Tip 4.13: You can choose from nine IDE tool window docking targets

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



When a tool window is in a dockable state, a set of docking targets appears when you move a tool window to a specific location, such as hovering it over another tool window. But did you know that there are nine IDE docking targets? These docking targets allow you to pin tool windows to the inner and outer parts of the IDE itself.



Docking target 1 puts a tool window into a tabbed document state, docking target 3 docks a tool window to the inner right edge, and docking target 7 docks a tool window to the outer right edge. If there's no tool window docked on the right, targets 7 and 3 seem to be the same. But if you dock tool window A using target 7 and then dock tool window B using target 3, you get tool window A on the outside and tool window B docked to the left side of tool window A.

You have no idea how crazy it was to test all of these combinations! But she loved it nonetheless.

Happy Programming! =)
Posted by Nils-Holger at 11:43 AM with 654 comments.

Friday, December 21, 2012

Tip 5.31: You can create keyboard shortcuts to navigate among the various Task List categories (by using View.NextTask and View.PreviousTask)

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


F8 and Shift+F8 are bound to the commands Edit.GoToNextLocation and Edit. GoToPreviousLocation. When the Task List is visible, these keyboard shortcuts navigate throughout all the tasks listed in a given category. However, if you want to navigate at any time among your various TODO comments or other tasks, regardless of whether the Task List is open, the Task List comes with two commands for doing this: View.NextTask and View.PreviousTask. Because we've already explored more than you ever wanted to know about the Task List, you now know that the Task List has several categories: User Tasks, Comments, and Shortcuts. These commands navigate only among items of a given category, so you won't jump from Shortcuts to User Tasks. Note that these commands are not bound to a keyboard shortcut by default in the General Development Settings, so you may need to bind them yourself, depending on your development settings.

VSTip5310

Go to Tools–Options–Environment–Keyboard, and in the Show Commands Containing edit box, type the command View.NextTask. Do a sanity check for whether the settings you are using already have the command bound to a keyboard shortcut. If a command is already bound to a keyboard shortcut, you'll see it in the Shortcut Currently Used By read-only combo box, which you can see in the preceding screen shot. If the command is not bound to a shortcut, in the Press Shortcut Keys edit box, type your preferred shortcut and click Assign. If you want this command to work only in the editor and not anywhere else in the IDE, use the Text Editor scope under the Use New Shortcut In drop-down list. Rinse and repeat for the View.PreviousTask command. For her, she used Ctrl+Alt+N, only because it wasn't bound to anything in the General Development Settings. For the previous action, she highly recommends just adding the Shift key to whatever key combination you come up with for View.NextTask, since the standard convention for any backward navigation is to include Shift. Also, something else to note, because she had to test for it, is that the Visual Studio status bar will update with the name of the comment when you use View.NextTask or View.PreviousTask.

VSTip5310a

Happy Programming! =)
Posted by Nils-Holger at 2:38 PM with 657 comments.

Thursday, December 20, 2012

Tip 5.30: You can show a full file path in the Task List

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


This tip applies only to comments and shortcuts, as user tasks are not saved with a file. Go to Tools–Options–Environment–Task List, and uncheck the Hide Full File Paths check box.

VSTip5300

And now the Task List displays the full paths for shortcuts.

VSTip5300a

Happy Programming! =)
Posted by Nils-Holger at 1:59 PM with 438 comments.

Wednesday, December 19, 2012

Tip 5.29: How to disable the prompt for deleting the Task List's user tasks

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


If you've created a few tasks and deleted them over time, you may have found that delete confirmation prompt to be annoying. Here's how you can disable it. On each user task, you'll see the Delete command on the context menu, as shown in the following screen shot.

VSTip5290

And when you click it, you'll get this prompt:

VSTip5290a

To disable this prompt, go to Tools–Options–Environment–Task List, and uncheck the Confirm Deletion Of Tasks check box.

VSTip5290b

Happy Programming! =)
Posted by Nils-Holger at 2:12 PM with 438 comments.

Tuesday, December 18, 2012

Tip 5.28: You can show HACK, UNDONE, and custom tokens in the Task List

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


TODO comments are not the only thing you can display under Comments in the Task List. If you go to Tools–Options–Environment–Task List, you'll see a Token List. By default, the Token List comes with HACK, UNDONE, and TODO, but you can create your own.

VSTip5280

Using a user-created TipOfTheDay token, she can type a comment in her code using the //TipOfTheDay token format, as shown here:

VSTip5280a

The TipOfTheDay comment now appears in the Task List.

VSTip5280b

Happy Programming! =)
Posted by Nils-Holger at 5:21 AM with 467 comments.

Monday, December 17, 2012

Tip 5.27: You can create shortcuts in your Task List

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Sara Aside

This is yet another feature she didn't know about until someone showed her.

You can store shortcuts in your Task List, and you can even use them as tasks to scratch off, if you want. And just like user tasks, shortcuts are saved in your solution .suo file, so they won't get checked into the source control. To create a Task List shortcut, go to the desired location in your editor (which can be any line of code or comment) and then go to Edit–Bookmarks–Add Task List Shortcut.

VSTip5270

Now you'll notice the shortcuts curved-arrow glyph appears in the indicator margin.

VSTip5270a

And now in the Task List, you'll see a new category called Shortcuts.

VSTip5270b

As illustrated in the preceding screen shot, you can also rename these shortcuts by double-clicking the description (or tabbing to the description field, for keyboard users) and then typing a new name.

Sara Aside

You may be wondering what the difference is between bookmarks and Task List shortcuts. At a high level, you won't see much difference. But, at the feature level, Task List shortcuts provide a few differences. Task List shortcuts display the entire line of code in the Task List window. Also, you can set a priority and check off these shortcuts as you complete them.

Happy Programming! =)
Posted by Nils-Holger at 3:12 PM with 435 comments.

Sunday, December 16, 2012

Tip 5.26: How to create and view TODO comments in the Task List

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Let's focus now on the other aspect of the Task List: the comments left in the code. You need to drop down the combo box at the top right to show Comments to be able to see your comment tokens (for example, UNDONE, TODO, and HACKS) in the Task List.

VSTip5260

So let's say that you have a TODO comment in your code as shown here.

VSTip5260a

By going to the Comments view in the Task List, you can now see your TODO comment.

VSTip5260b

Happy Programming! =)
Posted by Nils-Holger at 2:34 PM with 514 comments.

Saturday, December 15, 2012

Tip 5.25: You can assign a priority to your Task List's user tasks

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Now that you've created a user task, you can assign a priority. She calls this out as a separate tip, as it is most likely not intuitive that you can do this. Under the ! (exclamation point) column, you can click any cell to pop open the priority combo box.

VSTip5250

Then you'll be able to view and sort your user tasks based on priority.

VSTip5250a

Happy Programming! =)
Posted by Nils-Holger at 2:35 PM with 652 comments.

Friday, December 14, 2012

Tip 5.24: You can use the Task List to create user tasks that are separate from your code

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'


Sara Ford's Blog


A user task is saved in the .suo file per user, unlike a TODO, HACK, or UNDONE comment that you type into your source code. A .suo file stores all of a user's solution customizations, which you wouldn't want checked into source control.


VSTip5240

To create a user task, open View–Task List, make sure User Tasks is displayed in the combo box drop-down list, and then click the Create User Task button on the toolbar. Note that you can create the first task by directly editing the first row in the task list, but after that you need to press the button.

Then, as you finish your task, you can check the check box next to it to scratch it off.


VSTip5240a

And to delete a task, simply right-click it and choose Delete.


VSTip5240b

Happy Programming! =)

Posted by Nils-Holger at 1:05 PM with 692 comments.

Thursday, December 13, 2012

Tip 5.23: You can create new Toolbox tabs

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


You can create your own Toolbox tabs to store practically whatever you want in them. For that upcoming presentation, you can create your own tab by choosing the Add tab on the Toolbox context menu and adding content by using either the mouse or keyboard to populate content into your new tab. (Yes, the keyboard works too for cutting and pasting code from the editor into the Toolbox.)

VSTip5230

Sara Aside

She was going to create another tip called "Did you know you can move tabs?" but it doesn't really stand on its own as a separate tip. As she's writing this, she still has three hours of battery life left for her plane flight, and the plane attendant people (she can't spell what they are called, and her row-seat neighbors are tired of playing human dictionary for her) just served brownies.
You can drag and drop Toolbox tabs to new locations in the list, and their location will persist.

VSTip5230a
Happy Programming! =)
Posted by Nils-Holger at 1:29 PM with 441 comments.

Wednesday, December 12, 2012

Tip 5.22: You can use Ctrl+C to copy controls in a Toolbox tab and then use Ctrl+V to paste the controls into another Toolbox tab

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


You can use the mouse to drag and drop controls to a new tab, and you can even use Ctrl+Drag to copy controls to a new tab. But did you know you can use the keyboard to achieve the same functionality? Use the classic Ctrl+C to copy any Toolbox control, and use the classic Ctrl+V to paste into the desired tab location.

VSTip5220

Note how the preceding image illustrates having both code and a button control within the General tab. Also note that she has the Show All option enabled to show the disabled code because when she took this screen shot, the WinForms designer was the active document in the IDE.

Happy Programming! =)
Posted by Nils-Holger at 2:20 PM with 441 comments.

Tuesday, December 11, 2012

Tip 5.21: You can use Show All to find your hiding Toolbox controls

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

This tip comes directly from the developer who works on the Toolbox. He told her her sees a lot of questions where people are trying to figure out why a particular control isn't there, especially when they've just recently added controls.

What happens is that all the controls in the Toolbox are managed by the active designer. A designer is like an editor because it takes up the same region of space in the IDE, but it allows you to design UI rather than write code. You can recognize a designer by the [Design] in the file tab. So, if the currently active designer doesn't support a particular control, you won't see it when you add it to the Toolbox.

VSTip5210

By choosing Show All, you can at least verify that your control was added. Now, how to get it active depends on the control and which designer is needed. In the next screen shot, notice the scroll bar position on the right, showing just how many controls are now visible.

VSTip5210a

Happy Programming! =)
Posted by Nils-Holger at 1:02 PM with 435 comments.

Monday, December 10, 2012

Tip 5.20: You can switch between the Icon view and List Item view in the Toolbox

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Here's yet another action she had no idea you could use until someone showed it to her. By having just the Icon view open, you can save a lot of space within the Toolbox. For each Toolbox grouping, you can customize whether to show the flat list of controls and their names or just show their icons. Right-click anywhere in the desired group, and toggle off List View.

VSTip5200

Here's the Icon view that appears instead of the List View.

VSTip5200a

Happy Programming! =)
Posted by Nils-Holger at 1:15 PM with 456 comments.

Sunday, December 9, 2012

Tip 5.19: You can sort items in the Toolbox alphabetically

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Most of the time, the controls are listed in alphabetical order. But if you ever need to do a reset, you can bring up the Toolbox context menu and select Sort Items Alphabetically.

VSTip5190

Happy Programming! =)
Posted by Nils-Holger at 12:35 PM with 439 comments.

Saturday, December 8, 2012

Tip 5.18: You can use Ctrl+Up Arrow and Ctrl+Down Arrow to move among the various control groups in the Toolbox

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


You could page up and down throughout the Toolbox to reach the previous or next control group, or you could just use Ctrl+Up Arrow or Ctrl+Down Arrow.

VSTip5180

Happy Programming! =)
Posted by Nils-Holger at 1:37 PM with 649 comments.

Friday, December 7, 2012

Tip 5.17: You can use * to expand all and / to collapse all in the Toolbox

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Sara Aside

These keystrokes are not actually specific to the Toolbox, as they work for any standard TreeView control. She just calls them out in the Toolbox because this is where she first discovered the * (asterisk) and / (forward slash) in her test-case repository.

Typing * expands everything in the Toolbox. Typing / collapses everything. (Just type the / key; do not use Shift+/ because that will produce a ?.) Note that the * really does expand all items, including subnodes. In other words, she must warn you: do not, and she really means do not, try to do this at your root c:\ directory. If you do, you'll get to watch Windows Explorer expand every single folder on your machine, which may take a while. You can also consider using + (plus sign) and - (hyphen), which work for all standard TreeView controls without expanding all or collapsing all. She just tends to use the standard Right Arrow key to expand and Left Arrow key to collapse so that she don't have to reach as far. To recap, typing * or + or pressing the Right Arrow key expands the tab.

VSTip5170

And pressing / or - or pressing the Left Arrow key collapses the tab.

VSTip5170a

Happy Programming! =)
Posted by Nils-Holger at 1:24 PM with 442 comments.

Thursday, December 6, 2012

Tip 5.16: How to stop the Toolbox from autopopulating with items found in the solution

"Visual Studio Tip, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Sara Aside

The idea for this tip came from a blog reader. She'll admit that she didn't know how to keep the Toolbox from autopopulating. Fortunately, she can ask the developer on the feature directly and share the answer with everyone.

If you have a solution with lots of projects in it, and you notice the Toolbox is taking a long time scanning the solution for all possible Toolbox items, you can go to Tools–Options–Windows Forms Designer–General and set AutoToolboxPopulate to False.

VSTip5160

Happy Programming! =)
Posted by Nils-Holger at 2:34 PM with 442 comments.

Wednesday, December 5, 2012

Tip 5.15: Why does each Toolbox group have a Pointer control?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


You've probably noticed how the Pointer control appears at the top of each tab group. This is because whenever a control is selected in the Toolbox, the mouse pointer automatically becomes a drag pointer for that control, meaning that you just have to put your mouse pointer onto the form and click, and the control is dropped. You don't have to hold down any keys to do the actual drag. But you may not actually want to use the drop function at this time. You can put the focus on the Pointer control to ensure that you don't accidentally drop the item.

VSTip5150

Happy Programming! =)
Posted by Nils-Holger at 1:39 PM with 678 comments.

Tuesday, December 4, 2012

Tip 5.14: You can drag and drop code onto the Toolbox's General tab

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


This tip is especially helpful if you are going to write code in a presentation. Instead of having to type code in front of everyone, you can have it all typed up on the side, ready to go! You've probably noticed the Toolbox General tab showing this information by default.

VSTip5140

Probably one of the best-kept secrets is that you can actually drag and drop code onto the Toolbox. Just highlight some text and then Click+Drag and that text into the General tab. You'll see the following:

VSTip5140a

But it gets better. You can actually drag code to any tab on the Toolbox, including user-created tabs. Note that you may need to select Show All on the Toolbox context menu to display additional tabs so that you can drag the code onto the tab. But after that, the tab will appear whenever you can insert code.

VSTip5140b

Happy Programming! =)
Posted by Nils-Holger at 1:51 PM with 908 comments.

Monday, December 3, 2012

Tip 5.13: You cannot enable Stop Search on the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Sara Aside

You may have noticed the Stop Search command on the Output window context menu. She spent a good 20 minutes trying to figure out how to enable this command before she broke down and e-mailed the developer.


VSTip5130

Apparently, you can't enable it. It's because the Output window and the Find Results window share a lot of implementation, and it should have been hidden for the Output window case. Happy Programming! =)
Posted by Nils-Holger at 2:33 PM with 442 comments.

Sunday, December 2, 2012

Tip 5.12: You can redirect debug messages to the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Depending on your environment settings, such as the Visual Basic Development Settings, you may have noticed that the Output window's debug content is redirected to the Immediate Window instead. Or maybe you want the Output window's debug content to go to the Immediate Window. Go to the Tools–Options–Debugging–General page. On this page, you'll find the option Redirect All Output Window Text To The Immediate Window.

VSTip5120

To illustrate, let's say you have this option enabled and you hit an assert. You'll see the assert information in the Immediate Window and not in the Output window.

VSTip5120a

Happy Programming! =)
Posted by Nils-Holger at 1:55 PM with 740 comments.

Saturday, December 1, 2012

Tip 5.11: You can customize the color scheme in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog

On the Tools–Options–Environment–Fonts And Colors page, in the Show Settings For combo box, there's an Output Window option. When it's selected, you'll be able to customize the colors for the following types of text: Plain Text, Selected Text, and Inactive Selected Text. Additionally, you can customize the color of the Current List Location.

VSTip5110

If you set the Item Background to Black and the Item Foreground to White, the Output window displays the visited line in the new color scheme.

VSTip5110a

Sara Aside

For her, the dark blue has always been a bit distracting because it makes her think that the focus is in the Output window when it really is in the editor. Another good combination is to change Item Foreground to Cyan and Item Background to White.


Happy Programming! =)
Posted by Nils-Holger at 1:09 PM with 443 comments.

Friday, November 30, 2012

Tip 5.10: You can enable word wrap in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The Output window has an icon on the toolbar that allows you to enable word wrap.

Sara Aside

She doesn't use word wrap, as she prefers one line per error. But she see the potential if you have customized the Output window for space and need to read the entire line without having to scroll left or right.


Here is the Output window before pressing the Toggle Word Wrap button.

VSTip5100

Here is the Output window after pressing the Toggle Word Wrap button.

VSTip5100a

Happy Programming! =)
Posted by Nils-Holger at 12:51 PM with 466 comments.

Thursday, November 29, 2012

Tip 5.9: How to stop the Output window from showing itself during a build

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


At some point, you'll experience the Output window sliding out from its autohiding place during a build. If you want to fine-tune this experience so that the Output window shows only when you tell it to (maybe you just want to check the status bar for the build status or have the Error List pop up if errors occur), go to Tools–Options–Projects And Solutions–General. Check the option called Show Output Window When Build Starts.



Now the Output window will be displayed whenever a build is started.



Happy Programming! =)
Posted by Nils-Holger at 12:44 PM with 658 comments.

Wednesday, November 28, 2012

Tip 5.8: You can use the keyboard to jump to various panes within the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


The Output window has a Show Output From drop-down list, as shown in the following screen shot, to move between various outputs views (or panes), such as Debug and Build. There's a command called Window.NextSubPane that navigates to the next output pane.



The command in itself isn't that interesting, but you can bind it to a keyboard shortcut—for example, Ctrl+Shift+Alt+O, since Ctrl+Alt+O is the keyboard shortcut to use for the Output window under the General Development Settings.



Happy Programming! =)
Posted by Nils-Holger at 12:54 PM with 467 comments.

Tuesday, November 27, 2012

Tip 5.7: You can double-click messages in the Output window to jump to that location in the code

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


If you double-click any error or warning in the Output window, you jump directly to that location in the file or to the closest equivalent location. There's also a button on the Output window toolbar that allows you to do the same thing, just in case you ever wondered what this Find Message In Code button did.



Happy Programming! =)
Posted by Nils-Holger at 1:06 PM with 1748 comments.

Monday, November 26, 2012

Tip 5.6: You can use F8 and Shift+F8 to navigate among errors in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


F8 and Shift+F8 are bound to the commands Edit.GoToNextLocation and Edit. GoToPreviousLocation. If you have the Error List open, F8 and Shift+F8 take you directly to the error in question by highlighting that part of the code. If you have the Output window open, F8 and Shift+F8 put the cursor on each error listed.



Happy Programming! =)
Posted by Nils-Holger at 3:07 PM with 672 comments.

Sunday, November 25, 2012

Tip 5.5: How to create a command alias

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog

To create an alias, open the Command Window and type alias ha Help.About.



Now typing ha in the Command Window pops open the Help–About menu. But let's explore a more practical application. Consider creating the alias se for Solution Explorer, as shown here: >alias se View.SolutionExplorer The idea for this example is that while you are coding in the editor, you can press Ctrl+/ to jump to the Find window and type se. Actually, you've probably already used one of the predefined aliases before. The command Debug.Print is alias to ?. To see the full list of aliases, type alias.



Finally, to reset your Command Window aliases back to defaults, type alias /reset.



Or you can simply use the /delete switch to delete a particular alias—for example, type alias se /delete to delete that se alias. Happy Programming! =)
Posted by Nils-Holger at 9:15 PM with 598 comments.

Saturday, November 24, 2012

Tip 5.4: How to run external executables from the Command Window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog

The command Tools.Shell runs an external executable out of process from Visual Studio—for example, Shell . But of course, there are optional arguments. Following are examples of optional arguments for the Tools.Shell command: Shell [/commandwindow] [/dir:folder] [/outputwindow] [/args]
  • /commandwindow ( or /c) Use this command to display the executable's output in the Command Window.
  • /dir:folder Use this command to specify the working directory.
  • /outputwindow (or /o) Use this command to display the executable's output in the Output window.
For example, Shell /o xcopy.exe c:\users\nils-holger\documents\cmdwinlog.txt c:\users\nils-holger\logfiles displays the xcopy output in the Output window.
Happy Programming! =)
Posted by Nils-Holger at 11:17 PM with 3083 comments.

Friday, November 23, 2012

Tip 5.3: How to log your Command Window session

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog

You can record your Command Window session via the log command. Type log -on to start recording. To finish logging, type log -off. There is also an option to overwrite the existing file; if you don't choose this option, the log command appends the text by default.



Happy Programming! =)
Posted by Nils-Holger at 11:24 PM with 1054 comments.

Thursday, November 22, 2012

Tip 5.2: How to search from the Command Window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog

Almost all Visual Studio commands can be run via the Command Window, scope willing. The next screen shot shows what the UI looks like when you type in the Edit.Find command via the Command Window.



Here are the additional Command Window options:
  • >Edit.Find /options Shows which options are currently set
  • >Edit.Find /reset Clears all options
Examples of such commands include the following:
  • >Edit.Find MainForm /case /proc This is a Quick Find command that matches case in the current procedure.
  • >Edit.Find MainForm /o /w /m /u /h This is a Quick Find command that opens documents, matches a whole word, marks matches, searches up, and searches hidden regions, respectively.
  • >Edit.Replace Class1 Class2 /doc /all This is a Quick Replace command that replaces all occurrences of Class1 with Class2 in the current document.
  • >Edit.FindInFiles Program /lookin:"c:\Users\nils-holger\Documents\Visual Studio 2008\Projects" /ext:*.cs /text2 This is a Find In Files command that looks in the Projects folder for files with the .cs extension and shows results in the Find Results 2 window.
Happy Programming! =)
Posted by Nils-Holger at 11:30 PM with 509 comments.

Wednesday, November 21, 2012

Tip 5.1: You can run Visual Studio commands from the Command Window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog


Press Ctrl+Alt+A to open the Command Window, or go to View–Other Windows–Command Window. Now you can run various Visual Studio commands without having to go through the menus. Examples of such commands include the following:
  • >File.Open c:\samples\myFile.txt Opens a file without going through the menu
  • >Help vs.commandwindow Opens a Help topic directly
  • >? i Returns the contents of the variable i
  • >? i = 10 Sets the contents of the variable i
For more commonly used commands that take arguments for Visual Studio 2012, check out the following documentation:http://msdn.microsoft.com/en-us/library/c338aexd(v=vs.110).aspx

Autocompletion is also provided for both the commands



and their corresponding arguments.



Happy Programming! =)
Posted by Nils-Holger at 11:30 PM with 806 comments.