Sunday, February 2, 2020

[C#][Resolved] Check LinkLable open a link with default browser

Add "System.Diagnostics.Process.Start("http://www.your-website.com");" in your event handler, as usual if you double click the linkLabl in your design view, you would be leaded to related method.

An example:
private void linklabelGuide_LinkClicked(object sender,LinkLabelLinkClickedEventArgs e){
  string url = "https:/www.google.com";
  System.Diagnostics.Process.Start(url);
}
If you run the application and click the linkLabel, default broswer of your operating system would be opened and load the link you specificed.

Reference:

https://stackoverflow.com/questions/7154256/linklabel-open-in-default-web-browser

No comments :

Post a Comment