MindFusion.Wpf Pack Programmer's Guide
HyperlinkForm Class
Remarks See Also
 





Represents a form which can be used to create and modify cell hyperlinks in a worksheet.

Namespace: MindFusion.Spreadsheet.Wpf.StandardForms
Assembly: MindFusion.Spreadsheet.Wpf.StandardForms

 Syntax

C#  Copy Code

public class HyperlinkForm : Window, INotifyPropertyChanged, IComponentConnector

Visual Basic  Copy Code

Public Class HyperlinkForm
    Inherits Window
    Implements INotifyPropertyChanged, IComponentConnector

 Remarks

This form can be used to prompt the user for the hyperlink information of a worksheet cell. To use the form, create an instance of the HyperlinkForm class and call the ShowDialog method. The user's choice can be obtained from the HyperlinkType, Target, SubTarget, and HyperlinkToolTip properties. The following image shows the form:

 Example

The code below demonstrates how to use the form to edit the hyperlink of an existing cell.

C#  Copy Code

var form = new HyperlinkForm(workbook, cell.Hyperlink);
if (form.ShowDialog(this) == true)
{
    using (workbook.StartChangeOperation(worksheet))
    {
        if (string.IsNullOrEmpty(form.Target))
        {
            cell.RemoveHyperlink();
        }
        else
        {
            if (cell.Hyperlink != null)
            {
                cell.Hyperlink.Type = form.HyperlinkType;
                cell.Hyperlink.Target = form.Target;
                cell.Hyperlink.SubTarget = form.SubTarget;
            }
            else
            {
                cell.SetHyperlink(form.HyperlinkType, form.Target, form.SubTarget);
            }

            cell.Hyperlink.ToolTip = form.HyperlinkToolTip;
        }
    }
}

Visual Basic  Copy Code

Dim form = New HyperlinkForm(workbook, cell.Hyperlink)
If form.ShowDialog(Me) = True Then

    Using workbook.StartChangeOperation(worksheet)

        If String.IsNullOrEmpty(form.Target) Then

            cell.RemoveHyperlink()

        Else

            If cell.Hyperlink IsNot Nothing Then
                cell.Hyperlink.Type = form.HyperlinkType
                cell.Hyperlink.Target = form.Target
                cell.Hyperlink.SubTarget = form.SubTarget
            Else
                cell.SetHyperlink(form.HyperlinkType, form.Target, form.SubTarget)
            End If

            cell.Hyperlink.ToolTip = form.HyperlinkToolTip

        End If

    End Using

End If

 Inheritance Hierarchy

System.Object
    System.Windows.Threading.DispatcherObject
        System.Windows.DependencyObject
            System.Windows.Media.Visual
                System.Windows.UIElement
                    System.Windows.FrameworkElement
                        System.Windows.Controls.Control
                            System.Windows.Controls.ContentControl
                                System.Windows.Window
                                    MindFusion.Spreadsheet.Wpf.StandardForms.HyperlinkForm

 See Also

HyperlinkForm Members
MindFusion.Spreadsheet.Wpf.StandardForms Namespace