I am creating a windows application using C#, where in a button on the GUI when clicked, should open a website.
The web browser will be taken care of by the default settings.
I am curious as to how to do that?
You can wrap the buttons in anchors that href to the appropriate website. When the user clicks the button (input) they are directed to the destination specified in the href property of the anchor.
5. Most HTML forms have a submit button at the bottom of the form. Once all of the fields in the form have been filled in, the user clicks on the submit button to record the form data. The standard behaviour is to gather all of the data that were entered into the form and send it to another program to be processed.
If the point is to open a website in your application, you will have to use WebBrowser control. Put WebBrowser control on your form, and add this code to the button which is responsible for opening the site:
webBrowser1.Navigate("www.google.com");
This will open the specified link in the default web browser:
Process.Start("http://www.google.com");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With