다음을 통해 공유


OutputWindowPane.Clear 메서드

OutputWindowPane에서 모든 텍스트를 지웁니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
Sub Clear
void Clear()
void Clear()
abstract Clear : unit -> unit
function Clear()

설명

단일 창에서 모든 텍스트를 지웁니다.

예제

Sub ClearExample(ByVal dte As DTE2)

    ' Retrieve the Output window.
    Dim outputWin As OutputWindow = dte.ToolWindows.OutputWindow

    ' Find the "Test Pane" Output window pane; if it does not exist, 
    ' create it.
    Dim pane As OutputWindowPane
    Try
        pane = outputWin.OutputWindowPanes.Item("Test Pane")
    Catch
        pane = outputWin.OutputWindowPanes.Add("Test Pane")
    End Try

    ' Show the Output window and activate the new pane.
    outputWin.Parent.AutoHides = False
    outputWin.Parent.Activate()
    pane.Activate()

    ' Add a line of text to the new pane.
    pane.OutputString("Some text." & vbCrLf)

    If MsgBox("Clear the Output window pane?", MsgBoxStyle.YesNo) = _
        MsgBoxResult.Yes Then
        pane.Clear()
    End If

End Sub
public void ClearExample(DTE2 dte)
{
    // Retrieve the Output window.
    OutputWindow outputWin = dte.ToolWindows.OutputWindow;

    // Find the "Test Pane" Output window pane; if it doesn't exist, 
    // create it.
    OutputWindowPane pane = null;
    try
    {
        pane = outputWin.OutputWindowPanes.Item("Test Pane");
    }
    catch
    {
        pane = outputWin.OutputWindowPanes.Add("Test Pane");
    }

    // Show the Output window and activate the new pane.
    outputWin.Parent.AutoHides = false;
    outputWin.Parent.Activate();
    pane.Activate();

    // Add a line of text to the new pane.
    pane.OutputString("Some text." + "\r\n");

    if (MessageBox.Show("Clear the Output window pane?", "", 
        MessageBoxButtons.YesNo) == DialogResult.Yes)
        pane.Clear();
}

.NET Framework 보안

참고 항목

참조

OutputWindowPane 인터페이스

EnvDTE 네임스페이스

기타 리소스

방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행