I realise that this is a question asked a lot, but the best answer seems to be to use the "AcceptButton" option ... I don't have that option, why would that be ?!?

I am using VS2010 & C# for my program, but nowhere is there an "AcceptButton" option !!!

sorry but i cant get your point . please rephrase your question .
Regards

This part belongs to VB.Net so i use .Net code ok.

On the keypress event

If e.KeyChar=Chr(13) Then
Me.BtnOk_Click(Me.BtnOk,e)
End If

Private Sub BtnOk_Click(ByVal ....................) Handles BtnOk.Click
'BtnOk Code
End Sub

see the below screenshot which solve your problem

commented: Guided me straight to the problem ... +1

see the below screenshot which solve your problem

Aha ... it's on the FORM itself, I had checked the TAB, the BUTTON, the TEXTBOX, everywhere but the FORM !!!

Thanks ... much appreciated.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.