TextSelection::Text Property

 

Sets or gets the text selection.

Namespace:   EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

property String^ Text {
	String^ get();
	void set(String^ value);
}

Property Value

Type: System::String^

A string representing the text selection.

The Text property is the default property for the TextSelection object.

When the Text property is read, the text in the text selection is returned, and the selection itself is unchanged.

When the Text property is set, the value of Text is inserted in front of the text selection and then collapsed, similar to what happens when text is pasted into a document. Note that this property behaves just as it would when the editor is in insert (that is, nonovertype) mode. Any text after the 128th character is truncated.

If the Mode property of the TextSelection object is set to Column, then setting the Text property generates an error.

This example works only in Visual Studio .NET 2003. For more information, see .a0b479e4-3c83-4407-986c-1d7353d6a406

No code example is currently available or this language may not be supported.
Return to top
Show: