all of my code is as follows:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Diagnostics;
namespace Problem1Solution
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.LinkLabel linkLabel2;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.linkLabel2 = new System.Windows.Forms.LinkLabel();
((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(8, 8);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(144, 408);
this.dataGrid1.TabIndex = 0;
this.dataGrid1.Navigate += new System.Windows.Forms.NavigateEventHandler(this.dat aGrid1_Navigate);
//
// linkLabel1
//
this.linkLabel1.ActiveLinkColor = System.Drawing.Color.RoyalBlue;
this.linkLabel1.Location = new System.Drawing.Point(16, 16);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(128, 24);
this.linkLabel1.TabIndex = 1;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "Document Flow";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHand ler(this.linkLabel1_LinkClicked);
//
// linkLabel2
//
this.linkLabel2.ActiveLinkColor = System.Drawing.Color.RoyalBlue;
this.linkLabel2.Location = new System.Drawing.Point(16, 48);
this.linkLabel2.Name = "linkLabel2";
this.linkLabel2.Size = new System.Drawing.Size(128, 24);
this.linkLabel2.TabIndex = 2;
this.linkLabel2.TabStop = true;
this.linkLabel2.Text = "Document Flow";
this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHand ler(this.linkLabel2_LinkClicked);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(536, 437);
this.Controls.Add(this.linkLabel2);
this.Controls.Add(this.linkLabel1);
this.Controls.Add(this.dataGrid1);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void dataGrid1_Navigate(object sender, System.Windows.Forms.NavigateEventArgs ne)
{
}
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
Process pIE = new Process();
pIE.StartInfo.FileName = "http://www.google.com";
pIE.StartInfo.UseShellExecute = true;
pIE.Start();
}
private void linkLabel2_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
Process pIE2 = new Process();
pIE2.StartInfo.FileName = "http://www.yahoo.com";
pIE2.StartInfo.UseShellExecute = true;
pIE2.Start();
}
}
}
Hmm, doesn't happen in Internet explorer 7, it will open in a new tab.
Can I see the exact code your using?
But it could be that IE recognizes that it is already open and just changes sites instead, in which case, you might have to actually automate IE
http://www.novicksoftware.com/TipsAndTricks/tip-csharp-open-ie-browser.htm
-mwalts