Back to Devexpress

DrawingObject.AddHyperlink() Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-drawingobject-7e589b20.md

latest2.3 KB
Original Source

DrawingObject.AddHyperlink() Method

Adds a hyperlink to a shape.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
Hyperlink AddHyperlink()
vb
Function AddHyperlink As Hyperlink

Returns

TypeDescription
Hyperlink

A hyperlink attached to the drawing object.

|

Remarks

The following example inserts a picture and attaches a hyperlink to it:

csharp
Document document = wordProcessor.Document;
Shape picture = document.Shapes.InsertPicture(document.Range.Start, DocumentImageSource.FromFile("DevExpress.png"));
Hyperlink pictureHyperlink = picture.AddHyperlink();
pictureHyperlink.NavigateUri = "https://community.devexpress.com/blogs/";
pictureHyperlink.ToolTip = "Check the recent DevExpress blogs";
vb
Dim document As Document = wordProcessor.Document
Dim picture As Shape = document.Shapes.InsertPicture(document.Range.Start, DocumentImageSource.FromFile("DevExpress.png"))
Dim pictureHyperlink As Hyperlink = picture.AddHyperlink()
pictureHyperlink.NavigateUri = "https://community.devexpress.com/blogs/"
pictureHyperlink.ToolTip = "Check the recent DevExpress blogs"

Use the DrawingObject.Hyperlink property to access a hyperlink associated with a drawing object.

See Also

Hyperlink

DrawingObject Interface

DrawingObject Members

DevExpress.XtraRichEdit.API.Native Namespace