Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi-Line Text Box and Enter Key for New Line

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
Every once in a while one of my multi-line text boxes will no longer allow the user to hit the Enter Key for a new line. They can still type in text, but cannot create a new line. Does anyone have any ideas what might cause this and what I should look for? There really aren't any restrictions on this textbox in terms of Keypress, etc.

Auguy
Sylvania, Ohio
 
Does your form have a default button? Take a look at the AcceptButton property for the form.
 
There is nothing in the accept buttom property and I can find no reference to a default button. I do have a cancel button set. The only thing I do with this text box is toggle the readonly property on and off.

Auguy
Sylvania, Ohio
 
Default Button and the accept buttom property mean much the same thing. I was just guessing.

Another guess, do you have the Text Box's AcceptsReturn property set to false?
 
Thanks Aptitude. I checked and sure enough it was set to false. I guess the question I have now is why did it accept the Return Key all of this time and only fail once in a while? I checked my other multi-line text boxes and they are all set to False but still accept the Return Key to generate a new line. I think I will set all to True just to be safe. Is this a bug, or am I not looking at this incorrectly?

Auguy
Sylvania, Ohio
 
Is the Text Box directly on your form? It may be that if not one of the other controls the text box is in is capturing the Enter key. I'm not aware of any faults with this functionality, but you never know.
 
The text box is within a Group Box, on a page of a Tab Control. I can find no other Keypress code on this form that would affect the textbox.

Auguy
Sylvania, Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top