TryToShow Method (TextPane Object)
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.
Public Function TryToShow( _ ByVal Point As TextPoint, _ Optional ByVal How As vsPaneShowHow = vsPaneShowAsIs, _ Optional ByVal PointOrCount As Object _ ) As Boolean
Function TryToShow( _ ByVal Point As TextPoint, _ Optional ByVal How As vsPaneShowHow = vsPaneShowAsIs, _ Optional ByVal PointOrCount As Variant _ ) As Boolean
HRESULT __stdcall TryToShow( TextPoint* Point, vsPaneShowHow How, VARIANT PointOrCount, /* [out, retval] */ VARIANT_BOOL* retVal );
public bool TryToShow( TextPoint Point, vsPaneShowHow How, object PointOrCount );
public function TryToShow( Point : TextPoint, How : vsPaneShowHow, PointOrCount : Object ) : Boolean
- Required. The TextPoint location you want to attempt to show.
- Required. A vsPaneShowHow constant indicating how to display the text.
- 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.
True if the text can be displayed, False if not.
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
Applies To: TextPane Object