.net 闪烁网编辑器中的链接

.net 闪烁网编辑器中的链接,.net,hyperlink,scintilla,scintillanet,.net,Hyperlink,Scintilla,Scintillanet,如何为在闪烁网编辑器中键入的文本提供链接?有可能吗。任何建议都是值得考虑的。提前谢谢,我想这不是我的翻版 要将文档的一部分定义为链接,可以对其应用样式 您可以使用介于40和255之间的任何样式。例如,如果选择样式40将文本的一部分标记为链接,则可以用以下方式定义它 ScintillaCtlName.Styles[40].ForeColor = Color.Blue; ScintillaCtlName.Styles[40].BackColor = Color.White; ScintillaCtl

如何为在闪烁网编辑器中键入的文本提供链接?有可能吗。任何建议都是值得考虑的。提前谢谢,我想这不是我的翻版

要将文档的一部分定义为链接,可以对其应用样式

您可以使用介于40和255之间的任何样式。例如,如果选择样式40将文本的一部分标记为链接,则可以用以下方式定义它

ScintillaCtlName.Styles[40].ForeColor = Color.Blue;
ScintillaCtlName.Styles[40].BackColor = Color.White;
ScintillaCtlName.Styles[40].Bold = false;
//The "Hotspot" property allows you to raise an event when you click on the text where style # 40 is applied
ScintillaCtlName.Styles[40].Hotspot = true; 
ScintillaCtlName.Styles[40].Visible = true;
ScintillaCtlName.Styles[40].Underline = true;
您应该将事件处理程序附加到闪烁控制:

ScintillaCtlName.HotspotClick += 
new System.EventHandler<ScintillaNET.HotspotClickEventArgs>this.ScintillaCtlName_HotspotClick);
可能重复的
ScintillaCtlName.HotspotClick += 
new System.EventHandler<ScintillaNET.HotspotClickEventArgs>this.ScintillaCtlName_HotspotClick);
private void ScintillaCtlName_HotspotClick(object sender, HotspotClickEventArgs e)
{
    //Your code...
    MessageBox.Show("Link Clicked!!!");
    //e.Modifiers: gets the modifier keys (SHIFT, CTRL, ALT) held down when clicked.
    //e.Position: gets the zero-based document position of the text clicked.
}