Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2007

Tip: Looking for answers? Try searching our database.

How to allow user to enter 'Enter' in a RichTextBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Richard Lewis Haggard - 26 Jun 2007 15:21 GMT
In VS05, I have a form that has a standard RichTextBox control in which my
client wants to be able to type an Enter key and have the RichTextBox
respond by inserting a new line instead of either moving to the next control
in the Z order or closing the form. He doesn't want to use Ctrl+Enter. He
wants to use a plain Enter key. Now, back in the Bad Ole Days, there was an
attribute 'WantsReturnKey' that would enable exactly this sort of behaviour
but I do not see that particular attribute available now. What must one do
so that the Enter key is inserted into the RichTextBox instead of being
passed to the default form?
Signature

Richard Lewis Haggard
General: www.Haggard-And-Associates.com

"Have you noticed? Dogs have owners. Cats have staff."
Please come visit here for a couple thousand good giggles!:
www.haggard-and-associates.com/Humor/humor.htm

dbgrick - 26 Jun 2007 19:55 GMT
Set the AcceptsTab property to true on the RichTextBox control.

Rick D.
Contractor

> In VS05, I have a form that has a standard RichTextBox control in which my
> client wants to be able to type an Enter key and have the RichTextBox
[quoted text clipped - 5 lines]
> so that the Enter key is inserted into the RichTextBox instead of being
> passed to the default form?
Richard Lewis Haggard - 26 Jun 2007 23:31 GMT
Thanks. It never occurred to me to look there.

By the way, you'll love this - now my client has filed a bug report saying
that the Tab key no longer shifts focus out of the RichTextBox. Pardon me
while I go find something flat and unyielding against which to repeatedly
apply my forehead with the most speed and force I can muster.
Signature

Richard Lewis Haggard
General: www.Haggard-And-Associates.com
Please come visit here for a couple thousand good giggles!:
www.haggard-and-associates.com/Humor/humor.htm

> Set the AcceptsTab property to true on the RichTextBox control.
>
[quoted text clipped - 15 lines]
>> so that the Enter key is inserted into the RichTextBox instead of being
>> passed to the default form?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.