?
Solved

C# how to link button on Windows form to a website

Posted on 2005-05-02
2
Medium Priority
?
717 Views
Last Modified: 2010-04-17
I have a PUSHBUTTON on my Windows app which I want to bring the clicker to a website.
How do I code the click event handler or set some property at design time to do that?


Thanks.
0
Comment
Question by:rj94070
2 Comments
 
LVL 2

Assisted Solution

by:kHSw
kHSw earned 1000 total points
ID: 13915690
private void button1_Click(object sender, System.EventArgs e)
{
      System.Diagnostics.Process p = new System.Diagnostics.Process();
                p.StartInfo.FileName = "http://forum.khsw-be.net/";
      p.StartInfo.UseShellExecute = true;
      p.Start();
}
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 1000 total points
ID: 13915705
Did you try LinkLabel control available in Windows Forms toolbox?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformslinklabelclasstopic.asp

If you want to do this using button, use Process.Start Method (ProcessStartInfo) in the button handler. Set ProcessStartInfo.UseShellExecute Property to true and ProcessStartInfo.FileName to required URL.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Screencast - Getting to Know the Pipeline

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question