Hi all just a quick question, what code do I use to make user input of RETURN(enter button) defaulting to an OK button on a windows form? thanks for your time.

In form properties you will find property called "Accept button" set it to the button you need to be pressed if user press "Enter"

commented: Thanks for the help +1

aaah thanks very much thats great. Not too difficult to find either lol

double click that text box and write this code

this.AcceptButton= button1 (name of button you want as accept button)

shahab Qureshi

commented: Try not to resurrect 2 year old threads. +0