Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch a URL from a WinForms app

Tags:

winforms

I've got a VB.NET WinForms app in which I have the need to refer the user to a web page with documentation/help. I realize the LinkButton would get the trick done, but what I want is a standard Button control to launch the system default browser when that button is clicked. The only code I can find references the Win32 API, hooking the ShellExecute command:

ShellExecute(Me.Handle.ToInt32, "Open", "http://www.stackoverflow.com/", CStr(0), CStr(0), WindowStyle.SW_MAXIMIZE)

Does anyone else know how to do this in a "proper and pure" .NET manner?

like image 482
Mike C. Avatar asked Jan 08 '09 18:01

Mike C.


People also ask

How do I run a Winforms application in the browser?

You can right-click on the icon and then click on the 'Open Web Browser'. A Web browser window will open and your application will be running inside.


1 Answers

System.Diagnostics.Process.Start("http://www.website.com");

should work

like image 85
FallenAvatar Avatar answered Sep 28 '22 10:09

FallenAvatar