放一个linkLabel(工具箱里有),在它的的LinkClicked事件(双击生成)里输入 System.Diagnostics.Process.Start("explorer.exe", "http://www.baidu.com"); 就行了
可以用linkLabel控件
打开一个超链接
1 | System.Diagnostics.Process.Start( "http://www.google.com" ); |
能不能让IE新开一个窗口?只要把代码改成:
1 | System.Diagnostics.Process.Start( "iexplore.exe" , "http://www.google.com" ); |
如何把RichTextBox 中的某些文本显示成链接(单击可引发LinkClicked事件的那种)?在构造函数中 申明 this.yourTextbox.LinkClicked+=new System.Windows.Forms.linkClickEventHandler(this.yourTextbox_LinkedClick) 处理 很简单 private void yourTextbox_LinkedClick(object sender,System.Windows.Forms.linkClickEventArgs e) { System.Diagnostics.Process.Start(e.LinkText); }