EditPoint.ReadOnly(Object) Méthode

Définition

Retourne une valeur indiquant si une partie de la plage spécifiée contient du texte en lecture seule.

public:
 bool ReadOnly(System::Object ^ PointOrCount);
public:
 bool ReadOnly(Platform::Object ^ PointOrCount);
bool ReadOnly(winrt::Windows::Foundation::IInspectable const & PointOrCount);
[System.Runtime.InteropServices.DispId(139)]
public bool ReadOnly (object PointOrCount);
[<System.Runtime.InteropServices.DispId(139)>]
abstract member ReadOnly : obj -> bool
Public Function ReadOnly (PointOrCount As Object) As Boolean

Paramètres

PointOrCount
Object

Obligatoire. Objet TextPoint ou un certain nombre de caractères.

Retours

Boolean

true si la sélection contient du texte en lecture seule ; sinon, false.

Attributs

Exemples

Sub ReadOnlyExample()  
   Dim objTextDoc As TextDocument  
   Dim objMovePt As EditPoint  
   Dim objEditPt As EditPoint, iCtr As Integer  

   ' Create a new text file.  
   DTE.ItemOperations.NewFile("General\Text File")  

   ' Get a handle to the new document and create an EditPoint.  
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")  
   objEditPt = objTextDoc.StartPoint.CreateEditPoint  
   objMovePt = objTextDoc.EndPoint.CreateEditPoint  

   ' Insert ten lines of text.  
   For iCtr = 1 To 10  
      objEditPt.Insert("This is a test." & Chr(13))  
   Next iCtr  
   ' Move the active point to where the second edit point is  
   ' and then insert some text.  
   MsgBox("Is text read-only? " & objEditPt.ReadOnly(5))  
End Sub  

Remarques

Un caractère peut être en lecture seule si le document entier est marqué comme tel, ou si le caractère est contenu dans un bloc en lecture seule.

S’applique à