←Select platform

Hyperlink Property

Summary

Gets or sets a string which represents the hyperlink for this AnnObject.

Syntax
C#
VB
Objective-C
C++
Java
public string Hyperlink { get; set; } 
Public Property Hyperlink As String 
@property (nonatomic,copy) NSString* hyperlink; 
public String getHyperlink() 
public void setHyperlink(String hyperlink) 
public:  
   property String^ Hyperlink 
   { 
      String^ get() 
      void set(String^ value) 
   } 

Property Value

The hyperlink for this AnnObject. The default value is null.

Remarks

The hyperlink of an object can be any string value or null. It is up to the user's application to determine how to use this value.

Example

This example will create two annotation objects with hyperlinks and add them to a container, switches to run mode and run the hyperlink when the object is clicked.

C#
using LeadtoolsExamples.Common; 
using Leadtools.Annotations.Automation; 
using Leadtools.Annotations.Engine; 
using Leadtools.Codecs; 
using Leadtools.Annotations.WinForms; 
 
public void AnnObject_Hyperlink() 
{ 
   double inch = 720.0; 
 
   // Get the container 
   AnnContainer container = _automation.Container; 
 
   // Add a red on green rectangle from 1in 1in to 2in 2in 
   AnnRectangleObject rectObj = new AnnRectangleObject(); 
   rectObj.Rect = LeadRectD.Create(1 * inch, 1 * inch, 1 * inch, 1 * inch); 
   rectObj.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Red"), LeadLengthD.Create(1)); 
   rectObj.Fill = AnnSolidColorBrush.Create("Green"); 
   // Set its hyperlink 
   rectObj.Hyperlink = "https://www.leadtools.com"; 
   // Add it to the container 
   container.Children.Add(rectObj); 
 
   // Add a blue on yellow rectangle from 3in 3in to 4in 4in 
   rectObj = new AnnRectangleObject(); 
   rectObj.Rect = LeadRectD.Create(3 * inch, 3 * inch, 1 * inch, 1 * inch); 
   rectObj.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Blue"), LeadLengthD.Create(1)); 
   rectObj.Fill = AnnSolidColorBrush.Create("Yellow"); 
   rectObj.Hyperlink = "https://www.leadtools.com/downloads/demos.htm"; 
   // Add it to the container 
   container.Children.Add(rectObj); 
 
   // Subscribe to the Run event of the automation 
   _automation.Run += _automation_Run; 
 
   // Switch to run mode 
   _automation.Manager.UserMode = AnnUserMode.Run; 
 
   Debug.WriteLine("Run mode, click on the rectangles to go to their hyperlinks"); 
} 
 
void _automation_Run(object sender, AnnRunDesignerEventArgs e) 
{ 
   // Check for status == End 
   if (e.OperationStatus == AnnDesignerOperationStatus.End) 
   { 
      // Get the annotation object 
      AnnObject annObj = e.Object; 
      // Get its hyperlink string 
      string hyperlink = annObj.Hyperlink; 
      // Browse to it 
      if (!String.IsNullOrEmpty(hyperlink)) 
      { 
         Process.Start(hyperlink); 
      } 
   } 
} 
Requirements

Target Platforms

See Also

Reference

AnnObject Class

AnnObject Members

Help Version 20.0.2019.12.4
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations.Engine Assembly