I am writing a C# program using .NET and need to open multiple links at the same time into tabs in the default browser.
I have a list of links in a list box control and open them using :
private void btnOpenAllLinks_Click(object sender, EventArgs e)
{
if (this.lbLinks.Items.Count < 1)
{
MessageBox.Show("You must add at least one link to open.", "Invalid Selection");
}
else
{
foreach (string link in this.lbLinks.Items)
{
System.Diagnostics.Process.Start(@link);
}
}
}
This works fine in Google Chrome and Firefox, but in Internet Explorer it just opens the last link in the list.
I also have added to the double click event for the list box using :
private void btnOpenLink_Click(object sender, EventArgs e)
{
if (this.lbLinks.SelectedIndex == -1)
{
MessageBox.Show("You must select a link to open.", "Invalid Selection");
}
else
{
System.Diagnostics.Process.Start((string)this.lbLinks.SelectedItem);
}
}
If I double click each link in the list box then Internet Explorer will open them in different tabs, but if I use the Open All Links method then only the last link opens.
Does anyone have any ideas of what could be causing this?
Or if doing this another may would solve the problem?
Thanks!
This post has been edited by p0is0n: 03 April 2010 - 02:47 PM

New Topic/Question
Reply



MultiQuote


|