Question: I have simple Windows form With just one button which Calls one url

```
private void button1_Click(object sender, EventArgs e)
{
    ProcessStartInfo sInfo = new ProcessStartInfo("http://myurl.com/");
    Process.Start(sInfo);
}

```

When i click exe then it shows button and then i have to click button to perform action. Is it possible to call button click event automatically on clicking exe.

Answer: 
You can do the same with [`Form.Load`](https://msdn.microsoft.com/en-us/library/system.windows.forms.form.load(v=vs.110).aspx) event. Just refactor you code with [extract method](http://refactoring.com/catalog/extractMethod.html) to have no duplicated code and call your function in both event handlers:

```
private void button1_Click(object sender, EventArgs e)
{
    OpenUrl();
}

private void form1_Load(object sender, EventArgs e)
{
    OpenUrl();
}

private void OpenUrl()
{
    ProcessStartInfo sInfo = new ProcessStartInfo("http://myurl.com/");
    Process.Start(sInfo);
}

```
Simply call:

```
button1_Click(this, null);

```

from anywhere in your code.