2009-10-26 79 views

回答

1

一个解决方案,做的诀窍是将以下代码添加到DataGridView的CellClick事件。

if (this.dataGridViewName[e.ColumnIndex, e.RowIndex].Value.ToString().StartsWith("http")) 
     { 
      Process p = new Process(); 
      p.StartInfo.FileName = Utilities.getDefaultBrowser(); 
      p.StartInfo.Arguments = this.dataGridViewName[e.ColumnIndex, e.RowIndex].Value.ToString(); 
      p.Start(); 
     } 

我得到了代码从一个非常有用的文章启动浏览器还有getDefaultBrowser()代码here

+0

您可以手动跳过发现默认的浏览器,并让Windows如果只是路过自动使用它URL,如下所示:System.Diagnostics.Process.Start(dataGridViewName [e.ColumnIndex,e.RowIndex] .Value.ToString()); – jdh 2012-09-21 19:08:53

1

Put a user control那里有一个像链接,文本框或组合框,但只让其中一人在任何时间可见多个子控件。

相关问题