The HyperlinkEdit editor presents its content as a hyperlink. The text displayed in the edit box is underlined. When you activate the hyperlink functionality, the editor executes the command specified by the HyperlinkEdit.NavigationUrl property.
You can use the following approaches to invoke the hyperlink functionality:
a URL to open in the default browser ("www.devexpress.com")
a "mailto:" command that activates the default mail client ("mailto:firstname.lastname@example.org")
a path to a file or directory to open ("c:\Program Files", "\Server\Public\setup.exe")
The hyperlink editor provides a HyperlinkEdit.RequestNavigation event to control hyperlink execution. Using this event, you can perform an action not recognized by the system, modify the command to execute, etc. For instance, if the hyperlink editor contains an e-mail without the "mailto:" prefix, the default hyperlink processing will do nothing. However, you can handle the HyperlinkEdit.RequestNavigation event in order to make up a valid command by adding a "mailto:" prefix.
The code sample below demonstrates how to add the "mailto:" prefix for the hyperlink editor's displayed text (to enable opening a mail client).
Private Sub HyperlinkEdit_OnRequestNavigation(ByVal sender As Object, ByVal e As HyperlinkEditRequestNavigationEventArgs)
Dim emailUri As String = "mailto:" & e.NavigationUrl
e.NavigationUrl = emailUri
e.Handled = True
Was this page helpful?
Thanks for your feedback! Any other suggestions? Tell us here.