MoveToDisplayColumn Method
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

TextSelection.MoveToDisplayColumn Method

Moves the active point to the indicated display column.

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

void MoveToDisplayColumn (
	[InAttribute] int Line,
	[InAttribute] int Column,
	[OptionalAttribute] [InAttribute] bool Extend
void MoveToDisplayColumn (
	/** @attribute InAttribute() */ int Line, 
	/** @attribute InAttribute() */ int Column, 
	/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ boolean Extend
function MoveToDisplayColumn (
	Line : int, 
	Column : int, 
	Extend : boolean



Required. A vsGoToLineOptions constant representing the line offset, starting at one, from the beginning of the buffer.


Required. Represents the virtual display column, starting at one, that is the new column location.


Optional. Determines whether the moved text is collapsed or not. The default is false.

MoveToDisplayColumn moves the selected text to the specified line and column. If the column offset is in the middle of a tab character in the line, the active point is moved to the position immediately preceding the tab.

If the values of Line or Column are zero, then the active point remains at the current line number and/or column number.

Sub MoveToDisplayColumnExample()
   ' Before running this example, open a text document.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   ' Go to first line in document and select it.
   objSel.GotoLine(1, True)
   ' Move to various lines and offsets (character columns).
   objSel.MoveToAbsoluteOffset(3, True)
   objSel.MoveToDisplayColumn(3, True)
End Sub
© 2015 Microsoft