visual-studio Visual Studio 单击“查找结果”在错误的窗口中打开代码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4149225/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio Clicking Find Results Opens Code in Wrong Window
提问by JPM
I'm using Visual Studio 2010 and when I do a "Find in Files" the results are returned to the "Find Results 1" window which is docked below my code editor window.
我正在使用 Visual Studio 2010,当我执行“在文件中查找”时,结果将返回到停靠在我的代码编辑器窗口下方的“查找结果 1”窗口。
Before, I would double click on one of the results in the Find Results window and the file I clicked on would open in the code editor panel.
以前,我会双击“查找结果”窗口中的结果之一,然后我单击的文件会在代码编辑器面板中打开。
The problem is now when I click on one of the results, it opens in the same panel as the Find Results window which happens to be much smaller than the code editor window which is annoying.
现在的问题是,当我单击其中一个结果时,它会在与“查找结果”窗口相同的面板中打开,该面板恰好比令人讨厌的代码编辑器窗口小得多。
Does anyone know how to make it so that when I double click on the search results they open up in the code editor window again?
有谁知道如何做到这一点,以便当我双击搜索结果时,它们会再次在代码编辑器窗口中打开?
Thanks!
谢谢!
回答by Muhammad Mizanur Rahman
Click Window-> Reset window layout
单击窗口-> 重置窗口布局
回答by Dave Anderson
Works for VS2013 Update 4 and all newer versions, including VS2019.
适用于 VS2013 Update 4 和所有更新版本,包括 VS2019。
I thought I had this problem but it was easily fixed by docking the Find Results window using the very bottom of the window position selectors.
我以为我遇到了这个问题,但通过使用窗口位置选择器的最底部停靠“查找结果”窗口很容易解决。
The files open in the same position as the Find Results when the window is docked in the positions immediately next to the centre position.
当窗口停靠在紧邻中心位置的位置时,文件在与“查找结果”相同的位置打开。


回答by M.Bearden
This is also being discussed here: VS2010 docks code windows in the wrong place
这也在此处讨论: VS2010 在错误的地方停靠代码窗口
回答by devMomentum
Go the same... irritating... I realized that this unwanted behavior happened only while the app was running in debug. After I stopped debugging, a new panel was created with this file open in it. If I opened new files, they would open in this new panel. If I close all files in this new panel, opening new files from the "Find In Files" open in the standard code editor window (as long as the app is not running).
去一样......刺激......我意识到这种不受欢迎的行为仅在应用程序在调试中运行时发生。在我停止调试后,创建了一个新面板,其中打开了这个文件。如果我打开新文件,它们会在这个新面板中打开。如果我关闭此新面板中的所有文件,则从标准代码编辑器窗口中打开的“在文件中查找”打开新文件(只要应用程序未运行)。
回答by John
I had this problem also. I experienced the problem in VS2013. I did not want to do "Window -> Reset Window Layout" because it seemed like that was going to do other stuff that I did not want it to do.
我也有这个问题。我在 VS2013 中遇到过这个问题。我不想做“窗口 -> 重置窗口布局”,因为这似乎会做我不想做的其他事情。
Here was my solution:
这是我的解决方案:
I noticed the problem in VS2013 in which I had project "A" open.
I opened another copy of VS2013 and opened project "B".
I closed the copy of VS2013 that was exhibiting the annoying behavior: project A.
I closed the copy of VS2013 that had project B open.
This saved the settings from the "good" copy.
Opened project A in VS2013 and all was well.
我注意到在 VS2013 中我打开了项目“A”的问题。
我打开了另一个 VS2013 副本并打开了项目“B”。
我关闭了显示令人讨厌的行为的 VS2013 副本:项目 A。
我关闭了打开项目 B 的 VS2013 副本。
这保存了“好”副本中的设置。
在 VS2013 中打开项目 A,一切都很好。
Obviously, the caveat is that this requires you notice the problem before you close VS2013. But if you do notice it in time, this is a pretty easy solution.
显然,需要注意的是,这需要您在关闭 VS2013 之前注意到问题。但如果你及时注意到它,这是一个非常简单的解决方案。
回答by daltooon
For those who do not want to dock their "Find Results", "Error List", "Output",... windows to the right, and for those the above answer which is Window->Reset Window Layout doesn't work: may be you are trying to dock wrong place! You should dock these windows to very bottom. Refer here: https://stackoverflow.com/a/2735726/6176317
对于那些不想将“查找结果”、“错误列表”、“输出”、...窗口停靠在右侧的人,以及对于上述窗口->重置窗口布局的答案不起作用的人:可能是你试图停靠错误的地方!您应该将这些窗口停靠在最底部。请参阅此处:https: //stackoverflow.com/a/2735726/6176317
回答by Matt Arnold
For me, this was happening with a Visual Studio window containing an SQL file with the Window Split option active. If the cursor was in the top pane of the window, both Ctrl + F (Find) and Ctrl + H (Find & Replace) would cause the find control to appear in the other (main) Visual Studio window. Moving the SQL window into the main window just caused Find and Find & Replace to display the "Find in Files" dialog instead until another tab was selected.
对我来说,这是在 Visual Studio 窗口中发生的,该窗口包含一个 SQL 文件,并且窗口拆分选项处于活动状态。如果光标位于窗口的顶部窗格中,则 Ctrl + F(查找)和 Ctrl + H(查找和替换)都会导致查找控件出现在另一个(主)Visual Studio 窗口中。将 SQL 窗口移动到主窗口只会导致“查找”和“查找和替换”显示“在文件中查找”对话框,直到选择了另一个选项卡。
The workaround was to place the cursor in the bottom pane which caused both Find and Find & Replace to work correctly in that pane of that window. Unfortunately as long as the Window Split is there, the bug is still there in the top pane.
解决方法是将光标放在底部窗格中,这会导致“查找”和“查找和替换”在该窗口的该窗格中正常工作。不幸的是,只要 Window Split 存在,该错误仍然存在于顶部窗格中。

