立即窗口自动清洗在Visual Studio [英] Immediate Window automatic cleaning in Visual Studio

查看:147
本文介绍了立即窗口自动清洗在Visual Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于调试在Visual Studio中的问题。是否有可能一个调试应用程序每次启动前自动清除立即窗口在Visual Studio中?该> CLS 命令和上下文菜单 - >全部清除是有用的,但它们不是自动的,需要个人注意每次我运行该应用程序。此外, System.Diagnostics.Debug.Print()|写*()方法只能将消息写入立即窗口,所以> CLS 不适用。是否有该问题的任何解决方案? (目前我使用VS 2008)

I have a question about debugging in Visual Studio. Is it possible to clear the Immediate Window in Visual Studio automatically before each startup of a debugged application? The >cls command and Context Menu->Clear All are useful, but they are not automatic and require personal attention each time I run the application. Again, System.Diagnostics.Debug.Print()|Write*() methods can only write messages to the Immediate Window, so >cls is not applicable. Is there any solution for the problem? (Currently I use VS 2008)

感谢您的建议。

推荐答案

下面是做它的宏。在宏IDE类视图导航到MyMacros - EnvironmentEvents。打开(双击)EnvironmentEvents。将内部模块以下code:

Here is the macro that does it. In the Macros IDE Class View navigate to MyMacros - EnvironmentEvents. Open (double-click) EnvironmentEvents. Insert the following code inside module:

Private Sub BuildEvents_OnBuildDone( _
    ByVal Scope As EnvDTE.vsBuildScope, _
    ByVal Action As EnvDTE.vsBuildAction) _
    Handles BuildEvents.OnBuildDone

    Try
        Dim activeWin As Window = DTE.ActiveWindow
        Dim immedWin As Window = DTE.Windows.Item("{ECB7191A-597B-41F5-9843-03A4CF275DDE}")
        immedWin.Activate()
        DTE.ExecuteCommand("Edit.ClearAll")
        activeWin.Activate()
    Catch ex As Exception
    End Try
End Sub

在这里,你可以看到它应该是什么样子:

Here you can see how it should look like:

请参阅我的快速教程<一href="http://www.helixoft.com/blog/archives/6?n=how-to-create-and-run-macro-in-visual-studio-net">how创建和执行VS宏。

See my quick tutorial how to create and execute VS macro.

这篇关于立即窗口自动清洗在Visual Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆