Question: I have a form that takes user input and then let the user get connected to the sql server.
This is happening on button click.But where can I set the property Default button so that the user when clicks enter do the work of that button.

Answer: 
It is called `AcceptButton` now on the form; set that to the button that will be the default button.  

Refer to [Form.AcceptButton Property](http://msdn.microsoft.com/en-us/library/system.windows.forms.form.acceptbutton%28v=VS.100%29.aspx)
I have noticed severally how there is a mix up when it comes to an active button and an accept button. I just came out of it. So, I just thought I add a little option to the answers already given. Obviously, the best answer is;

`this.AcceptButton = AcceptButton;`

However, if you wish to have the button as an active control, this is what you do;

`this.ActiveControl = OkButton;`

details: <https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.containercontrol.activecontrol?view=netcore-3.1>

I hope it is helpful to anyone searching.