'宣言 Public Event LinkClicked As C1SuperLabelLinkClickedEventHandler
public event C1SuperLabelLinkClickedEventHandler LinkClicked
イベント データ
イベント ハンドラが、このイベントに関連するデータを含む、C1SuperLabelLinkClickedEventArgs 型の引数を受け取りました。次の C1SuperLabelLinkClickedEventArgs プロパティには、このイベントの固有の情報が記載されます。
プロパティ | 解説 |
---|---|
Button | Gets the button that was clicked on the link. |
HRef | Gets the value of the link's HREF attribute. |
Target | Gets the value of the link's TARGET attribute. |
解説
By default, tooltips are invisible to the mouse and therefore cannot be clicked. You must set the HitTestVisible property is to true in order to make the tooltip visible to the mouse (and clickable).
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.
使用例
The example below creates some hyperlinks using "A" tags. When the user clicks the link, the event handler shows a message box.
// configure c1superTooltip c1superTooltip.HitTestVisible = true; var tipText = "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."; c1superTooltip.SetToolTip(someControl, tipText); // attach event handler c1superTooltip.LinkClicked += c1superTooltip_LinkClicked; // ... void c1superTooltip_LinkClicked(object sender, C1SuperLabelLinkClickedEventArgs e) { if (e.HRef == "about") { MessageBox.Show("About C1SuperLabel!"); } else if (e.HRef == "time") { MessageBox.Show("The time is " + DateTime.Now.ToShortTimeString()); } }
参照