windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemtokenedit-52d17908.md
Fires when a user clicks a token.
Namespace : DevExpress.XtraEditors.Repository
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DXCategory("Events")]
public event TokenEditTokenClickEventHandler TokenClick
<DXCategory("Events")>
Public Event TokenClick As TokenEditTokenClickEventHandler
The TokenClick event's data class is DevExpress.XtraEditors.TokenEditTokenClickEventArgs.
The TokenClick event occurs when a user clicks a token caption or token glyph. Read the e.Value and e.Description event arguments to determine the clicked token.
private void tokenEdit1_Properties_TokenClick(object sender, DevExpress.XtraEditors.TokenEditTokenClickEventArgs e) {
if(e.Description.Contains("@"))
System.Diagnostics.Process.Start("mailto:" + e.Description);
}
Private Sub tokenEdit1_Properties_TokenClick(ByVal sender As Object, ByVal e As DevExpress.XtraEditors.TokenEditTokenClickEventArgs) _
Handles tokenEdit1.Properties.TokenClick
If e.Description.Contains("@") Then
System.Diagnostics.Process.Start("mailto:" & e.Description)
End If
End Sub
Note
The TokenClick event fires regardless of whether the caption or glyph is clicked. If the RepositoryItemTokenEdit.DeleteTokenOnGlyphClick property equals true , clicking the token glyph will automatically remove the token, whatever code the TokenClick event handler executes.
See Also