Today’s tip was a part of tip #8 from my TechEd 2008 IDE Tips and Tricks talk on using Visual Studio Commands from the command window and the find combo box.

In the standard command bar, you’ll see the Find Combo Box right next to Find in Files.  You can obviously type in a function name and hit enter to search, but where’s the fun in that?

Foo method in find combo box

Type in the name of the method, as i have above, and hit F9.  You’ll notice the breakpoint is set at function foo.

Breakpoint set at method foo

Why did this happen?

F9 is bound to a command called Debug.ToggleBreakpoint.  If there’s text in the find combo box and you run a VS command from within the find combo box, VS will use that text as the command parameter.  In the case of F9, VS toggled a breakpoint at the specified function, hence setting a breakpoint at foo().

Technorati Tags: VS2005Tip,VS2008Tip