I think this behaviour is by design. For considers last activated buttont
as default form button. According to "TextBox.AcceptsReturn Property" help
topic you must set this property to "true", to ensure RETURN key is always
handled by the textbox control.
--
Yuriy
"jgc" <jgc
...@hotmail.com> wrote in message
news:FE7BF2CD-3296-453D-A743-D8B35077444C@microsoft.com...
> There seems to be a bug where if you're in a textbox, a button can still
have focus and prevent you from using the "enter" key in the multi-line
textbox. This happens when you have a button and a textbox in a child form,
go to another child and return back to the initial child. Here's how to
re-create the problem:
> 1. Create a child form with a button and a MULTILINE textbox.
> 2. In the MDI parent form, open two of those child forms (you could do it
in the OnLoad event)
> 3. Run the program. Two child forms should show. Let's call the child
that's on top "child 1" and the other "child 2"
> 4. "child 1" is currently on top. Now, click on "child 2" and click back
on "child 1".
> 5. Click on the textbox on "child 1" and hit return ("ENTER"). You will
NOT be able to go down to the next line.
> It seems that upon re-activating "child 1", the form gives the button the
focus again, but does not "release" the focus even when you put the cursor
in the textbox.
> So, even though you click on the text box & put the cursor there, hitting
ENTER still makes the form fire the Click event on the button.
> I have not found anything like this in the KB. If you have any workaround
or know the solution please let us know.