I've built a simple winform with a textbox and an ok button. The ok button is declared as the form's AcceptButton, and its DialogResult is "OK".
The form validates the textbox contents by handling the Validating and Valided events, as per the sample code here: http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWindowsFormsControlClassValidatingTopic.asp When the textbox has invalid contents, and I physically *click* on the OK button, with the *mouse*, everything works as expected -- the textbox fails to validate. However, when I simply press [Enter], validation does not occur, and my OK button's OnClick handler is called as if all is well. Am I crazy? I've searched the archives, and groups.google.com, and nobody seems to be complaining about this yet. Cheers, -Shawn http://www.arithex.com/ You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.
