Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am just getting into development. I was wondering how hard would it be to setup a windows form with buttons that when clicked each of them would take you to a different url. Please Help.

Thanks,

Jason
Posted

The easiest way would be to use Process.Start Method[^].
C#
Process.Start("http:\\www.codeproject.com");
 
Share this answer
 
Comments
Espen Harlinn 24-Jan-12 17:06pm    
5'ed!
Sander Rossel 24-Jan-12 17:11pm    
Thanks Espen :)
If you are working with a web application, then you just need to do a Response.Redirect("http://mysite.com/") in the button click handler in the code-behind.
If you are working on a forms application, then you just need this in your click handler:
C#
ProcessStartInfo sInfo = new ProcessStartInfo("http://mysite.com/");  
Process.Start(sInfo);
 
Share this answer
 
Comments
Espen Harlinn 24-Jan-12 17:06pm    
5'ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900