Reset Find and Replace dialogs to Current Document

2020-07-11 06:10发布

问题:

Is there a way to force the Find and Replace dialog boxes, in visual studio, to auto select Current Document in the Look in drop down? It should do this only on reopening the dialog. I regularly forget to switch back from entire solution or project and end up wasting a lot of time waiting for VS to search everything including designer files! I'm hoping for a registry hack or something.

I'm sure this is a major annoyance for others too. Any tips on this would be greatly appreciated!

回答1:

Visual Studio retains separate settings for dialogs shown using Ctrl+F and Ctrl+Shift+F shortcuts, though dialogs themselves are identical. So when I want to search in current document, I hit Ctrl+F. When I want to search in Project/Solution/directory, I hit Ctrl+Shift+F and then choose where I want to search.



回答2:

As an alternative, you can use the Find combo box to only search the current document. The shortcut is Ctrl+/ or maybe Ctrl+D. It moves the focus to the Find combo box and you can type and press Enter to search.