Property HyperText
HyperText
Represents object that implements IEditHyperText
interface allowing to customize appearance and behaviour of hypertext sections within the control.
[TypeConverter(typeof(ExpandableObjectConverter))]
public virtual IEditHyperText HyperText { get; set; }
Property Value
Examples
Here is how to use a HyperText in the C# code:
public partial class Form1 : Form
{
private void Form1_Load(object sender, EventArgs e)
{
var syntaxEdit1 = new Alternet.Editor.SyntaxEdit(this.components);
syntaxEdit1.HyperText.HighlightHyperText = true;
syntaxEdit1.HyperText.JumpToUrl += new Alternet.Editor.UrlJumpEvent(this.SyntaxEdit1_JumpToUrl);
}
private void SyntaxEdit1_JumpToUrl(object sender, UrlJumpEventArgs e)
{
MessageBox.Show(e.Text);
e.Handled = true;
}
}
Here is how to use a HyperText in the Visual Basic code:
Partial Public Class Form1
Inherits Form
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim syntaxEdit1 = New Alternet.Editor.SyntaxEdit(Me.components)
syntaxEdit1.HyperText.HighlightHyperText = True
AddHandler syntaxEdit1.HyperText.JumpToUrl, New Alternet.Editor.UrlJumpEvent(AddressOf Me.SyntaxEdit1_JumpToUrl)
End Sub
Private Sub SyntaxEdit1_JumpToUrl(ByVal sender As Object, ByVal e As UrlJumpEventArgs)
MessageBox.Show(e.Text)
e.Handled = True
End Sub
End Class
Remarks
By default, the SyntaxEdit control highlights some text parts, such as HTTP or FTP links, as hypertext.
Use the HyperText property to specify which code should be recognized as hypertext and provide a custom action when the user clicks on it.