[]
        
(Showing Draft Content)

C1.Win.InputPanel.InputHtmlLabel.LinkClicked

LinkClicked Event

Event that fires when the user clicks a hyperlink within an InputHtmlLabel component.

Namespace: C1.Win.InputPanel
Assembly: C1.Win.InputPanel.8.dll
Syntax
public event LinkClickedEventHandler LinkClicked
Returns
Type Description
LinkClickedEventHandler Event that fires when the user clicks a hyperlink within an component.
Remarks

Hyperlinks are created using "A" tags in the HTML source text. When hyperlinks are clicked, the LinkClicked event fires and provides information about the link. The event handler can then take appropriate action.

Examples

The example below creates some hyperlinks using "A" tags. When the user clicks the link, the event handler shows a message box.

// configure InputHtmlLabel
inputHtmlLabel1.Text =
    "click <a href='about'><b>HERE</b></a> to see an about box.<br>" +
    "or click <a href='time'><b>HERE</b></a> to see the current time.";

// attach event handler
inputHtmlLabel1.LinkClicked += new LinkClickedEventHandler(inputHtmlLabel1_LinkClicked);
// ...

void inputHtmlLabel1_LinkClicked(object sender, LinkClickedEventArgs e)
{
  if (e.Button == MouseButtons.Left)
  {
    if (e.HRef == "about")
    {
      MessageBox.Show("About clicked!");
    }
    else if (e.HRef == "time")
    {
      MessageBox.Show("The time is " + DateTime.Now.ToShortTimeString());
    }
  }
}