As person helped me to figure out how to start open URL in default browser now I am having bit of a problem which causes to open URL in 2 different tabs when clicked. What could be the cause for this?
EDIT: I think it's good to point out that I am using a ListView in detailed mode. So when user clicks column with URL, it should open a single window in the browser.
lvWeb.MouseMove += new MouseEventHandler(lvWeb_MouseMove);
lvWeb.MouseUp +=new MouseEventHandler(lvWeb_MouseUp);
private void lvWeb_MouseMove(object sender, MouseEventArgs e)
{
var hit = lvWeb.HitTest(e.Location);
if (hit.SubItem != null && hit.SubItem == hit.Item.SubItems[1])
lvWeb.Cursor = Cursors.Hand;
else lvWeb.Cursor = Cursors.Default;
}
private void lvWeb_MouseUp(object sender, MouseEventArgs e)
{
var hit = lvWeb.HitTest(e.Location);
if (hit.SubItem != null && hit.SubItem == hit.Item.SubItems[1])
{
var url = new Uri(hit.SubItem.Text);
System.Diagnostics.Process.Start(url.ToString());
}
}