Expand Minimize
This topic has not yet been rated - Rate this topic

IEditorOperations.InsertTextAsBox Method

Inserts the specified text at the current caret position as a box.

Namespace:  Microsoft.VisualStudio.Text.Operations
Assembly:  Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)
bool InsertTextAsBox(
	string text,
	out VirtualSnapshotPoint boxStart,
	out VirtualSnapshotPoint boxEnd


Type: System.String

The text to be inserted in the buffer. Each "line" from the text will be written out a line at a time.

Type: Microsoft.VisualStudio.Text.VirtualSnapshotPoint

The start of the newly inserted box.

Type: Microsoft.VisualStudio.Text.VirtualSnapshotPoint

The end of the newly inserted box.

Return Value

Type: System.Boolean
true if the edit succeeded, otherwise false.

text is null.

This method has the same behavior as copying and pasting a box selection. In order to insert the text as a box, text is split by newlines and inserted a line at a time, each one on a successive line below the line the caret is on, starting at the caret's x coordinate on each line.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.