不在资源视图中时隐藏属性/工具箱窗格?
每次我在 Visual Studio (2005) 中查看表单或对话框时,“属性”和“工具箱”窗格都会显示在屏幕右侧。 这是很好的,因为它们对于操作对话框很有用。
然而,一旦我切换回源代码,这些窗格就会妨碍......有没有办法让它们自动消失?
Every time I view a form or dialog in Visual Studio (2005) the Properties and Toolbox panes show up on the right side of my screen. That's good to have because they are useful for manipulating dialogs.
However once I switch back to source code these panes just get in the way... is there a way to get them to go away automatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我最近在 VS2010 中使用一个宏做了一些事情,该宏在 asp.net MVC3 视图中从代码视图来回切换到设计视图时显示和隐藏“工具”面板。 我认为它可以很容易地适应你的情况。
该内容位于 VS Macro IDE 中预生成内容之后的
EnvironmentEvents
类文件中。使用事件指南而不是 if 语句可能会更好地优化它。 当您使用热键切换视图以及视图菜单(但不是上下文菜单)时,它会起作用。
I've done something recently in VS2010 using a macro that shows and hides the Tools panel when switching back and forth from code to design view in asp.net MVC3 views. It could be easily adapted to do the same for your situation I think.
This goes in the
EnvironmentEvents
class file in in the VS Macro IDE after the pre-generated content.It could probably be better optimized using the guids of the event rather than the if statements. It works when you use the hot keys for switching views as well as the view menu, but not the context menu.
对于 vs2015:
for vs2015:
我没有放弃屏幕右侧的空间,而是将属性和工具箱窗格拖到托管解决方案资源管理器和类视图等的左侧框架。我宁愿在屏幕上放置一个多功能框屏幕的一侧比将代码包围起来要好。 如果您同时需要它们,则可以将工具箱放在解决方案资源管理器窗格中,然后将属性窗格堆叠在解决方案资源管理器下方,这样可以始终与工具箱一起查看一些属性。
我知道这并不是您正在寻找的答案,但这是一种保持屏幕空间可用于代码而不干扰自动隐藏的不同方式(我发现自动隐藏实际上是一种烦恼而不是帮助。)
Rather than give up the space on the right side of the screen, I dragged my properties and toolbox panes over to the left-side frame that hosts the solution explorer and class view, etc. I'd rather have one multi-purpose box on one side of the screen than to have the code surrounded. If you need them both, you can put the toolbox in the solution explorer pane, then stack the properties pane beneath the solution explorer, which keeps a few properties in view at all times along with the toolbox.
I know it's not quite the answer you were looking for, but it's a different way of keeping that screen real estate available for code without messing with auto-hide (I find auto-hide to be really an annoyance more than a help.)
对于 vs2019:
我改进了 bh_earth0 的解决方案。 现在,当您跳转到代码时,它会保存属性和工具箱的可见性状态。 当设计选项卡被激活时,它会加载窗格的先前状态。
菜单> 扩展> 管理扩展
查找并安装“Visual Commander”。 (现在您有名为“VCmd”的新菜单)
菜单> “VCmd”> 扩展...(您将在右侧看到扩展窗格)
按扩展窗格中的添加按钮。 (新选项卡窗口将打开。)
为扩展写入名称(例如自动隐藏)。
选择语言为 C#。
复制并粘贴以下代码:
按“保存”。 然后按编译。 然后按安装
重新启动 Visual Studio 并享受:-)
For vs2019:
I improve bh_earth0's solution. Now it saves visibility states of Properties and ToolBox when you jump to code. And when design tab is activated it loads previous state of panes.
Menu > Extensions > Manage Extensions
Find and install "Visual Commander". (Now you have New Menu called "VCmd")
Menu > "VCmd" > Extensions ... (You will see an Extensions Pane At Right)
Press Add Button at the Extensions Pane. (New tab Wİndow will open.)
write a name for extention (e.g. AutoHide).
select language as C#.
copy and paste the code below:
Press Save. Then Press Compile. Then Press Install
Restart the Visual Studio and enjoy :-)
如果单击这些工具窗口上的“固定”图标,您可以切换窗口是始终保持打开状态,还是仅在鼠标靠近它们时保持打开状态。 当然,有时我的鼠标会朝那个方向移动,当我不希望它们弹出时,它们会弹出,但这就是生活......
If you click the 'pin' icon on those tool windows, you can toggle whether the windows stay open all the time, or only when the mouse is near them. Of course, sometimes my mouse strays over in that direction and they pop out when I don't want them to, but such is life...