Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Cut
Run
Expand Minimize

TryToShow Method (TextPane Object)

Visual Studio .NET 2003

Adjusts the location of the view in the text buffer so that the indicated range of text is shown in the text pane, if possible. You can control where in the pane the text displays.

[Visual Basic .NET]
Public Function TryToShow( _
   ByVal Point As TextPoint, _
   Optional ByVal How As vsPaneShowHow = vsPaneShowAsIs, _
   Optional ByVal PointOrCount As Object _
) As Boolean
[Visual Basic 6]
Function TryToShow( _
   ByVal Point As TextPoint, _
   Optional ByVal How As vsPaneShowHow = vsPaneShowAsIs, _
   Optional ByVal PointOrCount As Variant _
) As Boolean
[C++]
HRESULT __stdcall TryToShow(
   TextPoint* Point,
   vsPaneShowHow How,
   VARIANT PointOrCount,
   /* [out, retval] */ VARIANT_BOOL* retVal
);
[C#]
public bool TryToShow(
   TextPoint Point,
   vsPaneShowHow How,
   object PointOrCount
);
[JScript .NET]
public function TryToShow(
   Point : TextPoint,
   How : vsPaneShowHow,
   PointOrCount : Object
) : Boolean

Parameters

Point
Required. The TextPoint location you want to attempt to show.
How
Required. A vsPaneShowHow constant indicating how to display the text.
PointOrCount
Optional. A variant representing the end of a range of text to show. If PointOrCount is a number of characters, the characters follow Point. If PointOrCount is a point before Point, then it will be at the top of the text pane if How is set to vsPaneShowTop.

If How is set to vsPaneShowCentered, and the number of lines in the selected text is greater than the height of the pane, then the top line of the selected text is placed at the top of the pane.

Return Value

True if the text can be displayed, False if not.

Example

Sub TryToShowExample()
   Dim objTW As TextWindow
   Dim objPane As TextPane
   Dim objStart As TextPoint

   Set objTW = ActiveWindow.Object
   Set objPane = objTW.ActivePane
   Msgbox "The active pane is " & str(objPane.Height) & " lines high and " & str(objPane.Width) & " columns wide."
   Set objStart = objPane.StartPoint
   Msgbox "It begins at line " & str(start.Line) & ", column " & str(start.LineCharOffset) & "."
   objPane.TryToShow(objStart, vsPaneShowHow.vsPaneShowCentered)
End Sub

See Also

Applies To: TextPane Object

Show:
© 2015 Microsoft