←Select platform

SetSelectedTextItems Method

Summary

Replaces the selected text items for a page.

Syntax

C#
VB
C++
public void SetSelectedTextItems( 
   int pageNumber, 
   IList<DocumentViewerTextItem> items 
) 
Public Sub SetSelectedTextItems( 
   ByVal pageNumber As Integer, 
   ByVal items As System.Collections.Generic.IList(Of Leadtools.Documents.UI.DocumentViewerTextItem) 
) 
public:  
   void SetSelectedTextItems( 
      int pageNumber, 
      System::Collections::Generic::IList<Leadtools::Documents::UI::DocumentViewerTextItem^>^ items 
   ) 

Parameters

pageNumber

Pager number to use. This value cannot be 0 and must be a valid page number.

items

Collection of DocumentViewerTextItem that contains the new selected text. If this parameter is

null or an empty list, then the text selection of the page is cleared.

Remarks

DocumentViewerText stores the selection state of the text of each page in the document internally. It will use this value to highlight the selected text on the view ImageViewer control when RenderSelection is true.

When a new document is set in the document viewer, none of the text in its pages is selected. This can change by the viewer when during any of the following:

All these methods will call SetSelectedTextItems to update the state. This method will perform the following:

Use GetSelectedTextItems to get the currently selected text item for a page and GetSelectedText to get the selected text as a simple string object. Use HasSelectedText to check whether a page or the whole document has any selected text. The text of each page is obtained through the DocumentPage.GetText method and result is saved in the DocumentViewerText. If the text of a document has not been obtained, then the viewer will perform this automatically when the value of AutoGetText is true.

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Documents.UI.WinForms Assembly