2009-10-26 43 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那裏有一個像鏈接,文本框或組合框,但只讓其中一人在任何時間可見多個子控件。

相關問題