Is it possible to programmatically clear the Output Window in Visual Studio?

前端 未结 4 1076
执念已碎
执念已碎 2021-01-17 16:14

Do you know a way to add some code that, during debug, programmatically clear the Output Window in Visual Studio?

Or do you know so

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-17 16:35

    To clear the IMMEDIATE window in VS2010

        Dim dte = Marshal.GetActiveObject("VisualStudio.DTE.10.0")
        Dim ide As EnvDTE80.DTE2 = dte
        Dim currentActiveWindow = dte.ActiveWindow
        dte.Windows.Item("{ECB7191A-597B-41F5-9843-03A4CF275DDE}").Activate() 'Activate Immediate Window  
        dte.ExecuteCommand("Edit.SelectAll")
        dte.ExecuteCommand("Edit.ClearAll")
        currentActiveWindow.Activate()
    
        Marshal.ReleaseComObject(dte)
    

提交回复
热议问题