MobileForms Toolkit Documentation

AdvancedTree.LinkClick Event

Occurs when the link in the control is clicked.

public event LinkEventHandler LinkClick;

Remarks

Occurs when the link in the control is clicked. When the user clicks on the link, LinkClick event will occur instead of other actions, like selecting the node or clicking the cell. LinkClick event can occur also in nodes, that are not selected, without selecting the node.

LinkClick event has arguments of type LinkEventArgs.

Example

LinkClick event is used to invoke the internet explorer to display the home page of the customer, or to send email:

[Visual Basic]
      
Private Sub AdvancedTree1_LinkClick(ByVal sender As Object, ByVal e As Resco.Controls.AdvancedTree.LinkEventArgs)_
 Handles AdvancedTree1.LinkClick
    ' Handle the link click event
    If e.Node.CurrentTemplateIndex = 2 Then
        Select Case e.CellIndex
            Case 8 ' E-mail
                ' Run New Message dialog
                CreateProcess("iexplore", "MailTo:" & e.Target, IntPtr.Zero, IntPtr.Zero, _
                               False, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero)

            Case 10 ' Web address
                ' Run Internet Explorer
                CreateProcess("iexplore", e.Target, IntPtr.Zero, IntPtr.Zero, False, 0, _
                               IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero)

        End Select
    End If
End Sub
            
    
[C#]
      
private void advancedTree1_LinkClick(object sender, Resco.Controls.AdvancedTree.LinkEventArgs e)
{
    // Handle the link click event 
    if (e.Node.CurrentTemplateIndex == 2)
    {
        switch (e.CellIndex)
        {
            case 8: 
                // E-mail
                // Run New Message dialog
            
                CreateProcess("iexplore", "MailTo:" + e.Target, IntPtr.Zero, IntPtr.Zero, 
                               false, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
                break;

            case 10: 
                // Web address
                // Run Internet Explorer
            
                CreateProcess("iexplore", e.Target, IntPtr.Zero, IntPtr.Zero, false, 0, 
                               IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
                break;

        }
    }
}
            
    

See Also

AdvancedTree Class | Resco.Controls.AdvancedTree Namespace