I've looked everywhere, including the MSDN forums, but no one has even mentioned this or ways to do it. The basic idea is that once a Button is dragged from the toolkit, how do you then link that button to a web page, ie I have a 'Facebook' button, how do I then make it so that when the button is clicked, Facebook opens in a new browser window?
Once you've dragged the button onto the designer, you can double-click on it to open up the Button's Click
event handler. This is the code that will get run when the user clicks. You can then add the required logic, ie:
private void button1_Click(object sender, EventArgs e)
{
// Launch browser to facebook...
System.Diagnostics.Process.Start("http://www.facebook.com");
}
You can use Process.Start with the desired URL to open the default browser and navigate to the page:
using system.Diagnostics;
private void button1_Click(object sender, EventArgs e)
{
Process.Start("http://www.YouTube.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