Back to Devexpress

RepositoryItemCheckEdit.HyperlinkClick Event

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemcheckedit.md

latest3.8 KB
Original Source

RepositoryItemCheckEdit.HyperlinkClick Event

Occurs when a hyperlink within the current RepositoryItemCheckEdit control’s caption is clicked.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public event HyperlinkClickEventHandler HyperlinkClick
vb
<DXCategory("Events")>
Public Event HyperlinkClick As HyperlinkClickEventHandler

Event Data

The HyperlinkClick event's data class is HyperlinkClickEventArgs. The following properties provide information specific to this event:

PropertyDescription
LinkGet or sets the URL of the clicked hyperlink.
MouseArgsGets or sets mouse coordinates calculated from the toolbar’s upper left corner.
TextGets or sets the hyperlink alt text. Note that modifying this text does not change the item caption.

Remarks

If you use HTML Text Formatting to format your CheckEdit control’s caption, you can display the desired string as a hyperlink. To do so, use the <href></href> tag. The figure below illustrates the example.

To enable HTML text formatting, set the RepositoryItem.AllowHtmlDraw property to DefaultBoolean.True.

When an end-user clicks such a hyperlink, the HyperlinkClick event fires. Handle it to perform required actions. For example, the following code starts a default browser to display the web page, stored within the hyperlink.

csharp
checkEdit1.Text = "Visit the <href=www.devexpress.com>DevExpress Web Site</href>";
. . .
private void checkEdit1_Properties_HyperlinkClick(object sender, HyperlinkClickEventArgs e) {
    System.Diagnostics.Process.Start(e.Link);
}
vb
Private checkEdit1.Text = "Visit the <href=www.devexpress.com>DevExpress Web Site</href>"
. . .
Private Sub checkEdit1_Properties_HyperlinkClick(ByVal sender As Object, ByVal e As HyperlinkClickEventArgs)
    System.Diagnostics.Process.Start(e.Link)
End Sub

Clicking a hyperlink within a CheckEdit control does not affect its checked state and vice versa, and checking or unchecking a CheckEdit does not trigger the HyperlinkClick event.

See Also

AllowHtmlDraw

HTML-inspired Text Formatting

RepositoryItemCheckEdit Class

RepositoryItemCheckEdit Members

DevExpress.XtraEditors.Repository Namespace