SubDocument.Hyperlinks Property
Provides access to a collection of hyperlinks in the document.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v20.1.Core.dll
NuGet Package: DevExpress.RichEdit.Core
NuGet Packages: DevExpress.RichEdit.Core, DevExpress.WindowsDesktop.RichEdit.Core
Declaration
Property Value
Type | Description |
---|---|
HyperlinkCollection | A HyperlinkCollection interface which exposes a collection of hyperlinks. |
Remarks
Use the HyperlinkCollection.Create method to add a new hyperlink.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/bookmarks-and-hyperlinks-simple-example-t548777
Document document = richEditControl1.Document;
//Find the specific text string in a document
DocumentRange[] foundRanges = document.FindAll("DevExpress WinForms Rich Text Editor",
SearchOptions.CaseSensitive);
if (foundRanges.Length > 0)
{
//Create a hyperlink from a found range
document.Hyperlinks.Create(foundRanges[0]);
//Set the URI and the tooltip for the created hyperlink
document.Hyperlinks[0].NavigateUri = "https://www.devexpress.com/Products/NET/Controls/WinForms/Rich_Editor/";
document.Hyperlinks[0].ToolTip = "WinForms Rich Text Editor";
}
Note
The hyperlink attached to a shape is not added to the HyperlinkCollection. Check the Shape.Hyperlink property to retrieve the hyperlink.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Hyperlinks property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.