Setting focus to multi-line textbox?

V

VMI

In my Windows app, if I'm in a multi-line textbox and I'm writing a postal
address (ie. write ist line and press <Enter>, write 2nd line and press
<Enter>, etc...) how can I make sure that the Enter key will ALWAYS make the
cursor jump to the following line in the textbox? For some reason, and this
happens everywhere
except on my development PC, if a user's writing a line and presses the
<Enter> key, the program interprets that as the user pressing another button
in the Form (instead of jumping to the next line of the multi-line textbox).
I think it has something to do with where the focus is on the Form, but as
long as the cursor's on the multi-line, an <Enter> press always has to jump
to the next line. How can i make sure that it always happens?

The worst part is that I can't debug it in my dev PC because it never
happens there.

Thanks.
 
D

Dan Bass

If the form has got an AcceptButton linked to a button, then enter on the
form will cause a button clicked event to be fired on this button, UNLESS
the current focus is sitting in a control which has the "AcceptReturn"
property set to true.

Does your text box have this property set to true?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top