LinkLabel (c#)
-
I want to add a Link label to a form ,and when a user clicks on it the browser opens and navigate to that link in the .net help the follwing code has been given protected void LinkLabel1_LinkClicked(object sender, System.EventArgs e) { // Change the color of the link text by setting LinkVisited // to True. linkLabel1.LinkVisited = true; // Call the Process.Start method to open the default browser // with a URL: System.Diagnostics.Process.Start("http://www.Microsoft.com"); } but it didn't work bcos the app enters to the debug mode..any suggestions?:confused: samitha
-
I want to add a Link label to a form ,and when a user clicks on it the browser opens and navigate to that link in the .net help the follwing code has been given protected void LinkLabel1_LinkClicked(object sender, System.EventArgs e) { // Change the color of the link text by setting LinkVisited // to True. linkLabel1.LinkVisited = true; // Call the Process.Start method to open the default browser // with a URL: System.Diagnostics.Process.Start("http://www.Microsoft.com"); } but it didn't work bcos the app enters to the debug mode..any suggestions?:confused: samitha
Try creating a
Process
object and alter theProcessStartInfo
properties toUseShellExecute
. Something like this:Process webLink = new Process();
webLink.StartInfo.FileName = "http://www.microsoft.com";
webLink.StartInfo.UseShellExecute = true;
webLink.Start();This will launch the URL as if you typed it in the Start/Run box of Windows. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome