OutputWindowPane.OutputString(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sends a text string to the OutputWindowPane window.
public:
void OutputString(System::String ^ Text);
public:
void OutputString(Platform::String ^ Text);
void OutputString(std::wstring const & Text);
[System.Runtime.InteropServices.DispId(5)]
public void OutputString (string Text);
[<System.Runtime.InteropServices.DispId(5)>]
abstract member OutputString : string -> unit
Public Sub OutputString (Text As String)
Parameters
- Text
- String
Required. The text characters to send to the window.
- Attributes
Examples
Sub OutputStringExample(ByVal dte As DTE2)
' Find and show the "Test Pane" Output window pane.
Dim outputWin As OutputWindow = dte.ToolWindows.OutputWindow
Dim pane As OutputWindowPane
Try
pane = outputWin.OutputWindowPanes.Item("Test Pane")
Catch
pane = outputWin.OutputWindowPanes.Add("Test Pane")
End Try
outputWin.Parent.Activate()
pane.Activate()
' Add a line of text to the new pane.
pane.OutputString("Some text." & vbCrLf)
End Sub
public void OutputStringExample(DTE2 dte)
{
// Find and show the "Test Pane" Output window pane.
OutputWindow outputWin = dte.ToolWindows.OutputWindow;
OutputWindowPane pane;
try
{
pane = outputWin.OutputWindowPanes.Item("Test Pane");
}
catch (Exception)
{
pane = outputWin.OutputWindowPanes.Add("Test Pane");
}
outputWin.Parent.Activate();
pane.Activate();
// Add a line of text to the new pane.
pane.OutputString("Some text." + "\r\n");
}
Remarks
This method does not automatically add newline characters to the string. If you want such characters in the string, you must add them to Text
.