Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.4.3
|
Leadtools.Documents.UI Namespace > DocumentViewerText Class : SetSelectedTextItems Method |
public void SetSelectedTextItems( int pageNumber, IList<DocumentViewerTextItem> items )
'Declaration
Public Sub SetSelectedTextItems( _ ByVal pageNumber As Integer, _ ByVal items As IList(Of DocumentViewerTextItem) _ )
'Usage
Dim instance As DocumentViewerText Dim pageNumber As Integer Dim items As IList(Of DocumentViewerTextItem) instance.SetSelectedTextItems(pageNumber, items)
public: void SetSelectedTextItems( int pageNumber, IList<DocumentViewerTextItem^>^ items )
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:
If DocumentViewerSelectTextInteractiveMode is active and the user clicks and drags on the page to select text.
When SelectAll, SelectText or Find are called to alter the selection text state for a page or the whole document. Or ClearSelection to clear the text selection.
All these methods will call SetSelectedTextItems to update the state. This method will perform the following:
Fires the Operation event with DocumentViewerOperation.TextSelectionChaged before and after working on the whole document.
Fires the Operation event with DocumentViewerOperation.PageTextSelectionChanged before and after working on each page.
Update the internal text selection state.
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.