TextPane.TryToShow, méthode

Ajuste l'emplacement de la vue dans le tampon de texte afin que la plage de texte indiquée s'affiche dans le volet de texte, si possible. Vous pouvez contrôler l'emplacement d'affichage du texte dans le volet.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

'Déclaration
Function TryToShow ( _
    Point As TextPoint, _
    How As vsPaneShowHow, _
    PointOrCount As Object _
) As Boolean
bool TryToShow(
    TextPoint Point,
    vsPaneShowHow How,
    Object PointOrCount
)
bool TryToShow(
    [InAttribute] TextPoint^ Point, 
    [InAttribute] vsPaneShowHow How, 
    [InAttribute] Object^ PointOrCount
)
abstract TryToShow : 
        Point:TextPoint * 
        How:vsPaneShowHow * 
        PointOrCount:Object -> bool 
function TryToShow(
    Point : TextPoint, 
    How : vsPaneShowHow, 
    PointOrCount : Object
) : boolean

Paramètres

  • PointOrCount
    Type : System.Object
    Facultatif.Variant représentant la fin d'une plage de texte à afficher.Si PointOrCount est un nombre de caractères, les caractères suivent Point.Si PointOrCount est un point situé avant Point, il se situera en haut du volet de texte si How a la valeur vsPaneShowTop.
    Si How a la valeur vsPaneShowCentered, et que le nombre de lignes du texte sélectionné est supérieur à la hauteur du volet, la ligne supérieure du texte sélectionné est placée en haut du volet.

Valeur de retour

Type : System.Boolean
true si le texte peut être modifié ; sinon false.

Exemples

Sub TryToShowExample(ByVal dte As EnvDTE.DTE)
    Dim objTW As TextWindow
    Dim objPane As TextPane
    Dim objStart As TextPoint

    objTW = dte.ActiveWindow.Object
    objPane = objTW.ActivePane
    MsgBox("The active pane is " & Str(objPane.Height) & " lines high _
    and " & Str(objPane.Width) & " columns wide.")
    objStart = objPane.StartPoint
    MsgBox("It begins at line " & Str(objStart.Line) & ", column " & _
    Str(objStart.LineCharOffset) & ".")
    objPane.TryToShow(objStart, vsPaneShowHow.vsPaneShowCentered)
End Sub
public void TryToShowExample(_DTE dte)
{
    TextWindow tw;
    TextPane tpn;
    TextPoint tpt;

    tw = (TextWindow)dte.ActiveWindow.Object;
    tpn = tw.ActivePane;
    MessageBox.Show ("The active pane is " + tpn.Height.ToString () + " 
    lines high and " + tpn.Width.ToString () + " columns wide.");
    tpt = tpn.StartPoint;
    MessageBox.Show ("It begins at line " + tpt.Line.ToString () + ", 
    column " + tpt.LineCharOffset.ToString () + ".");
    tpn.TryToShow (tpt,vsPaneShowHow.vsPaneShowCentered,1);
}

Sécurité .NET Framework

Voir aussi

Référence

TextPane Interface

EnvDTE, espace de noms