We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set an textboxext didnt allow new line

Thread ID:





78000 Nov 25,2008 05:47 AM UTC Nov 25,2008 11:49 AM UTC WinForms 1
Tags: Tools
Sherly Numawaty
Asked On November 25, 2008 05:47 AM UTC

dear all,

how to set an textboxext didnt allow new line when we keyed 'enter' key from keyboard??

many thanks


Fathima Shalini P [Syncfusion]
Replied On November 25, 2008 11:49 AM UTC

Hi Sherly,

Thank you for your interest in Syncfusion Products.

Internally our TextBoxExt is derived from TextBox. So to avoid returning to the newline of the TextBox by pressing Enter key when it is set to multiline we need to set the AcceptsReturn property of the TestBoxExt to false and need to set a button as the Form's AcceptButton. So when we press "Enter" key it triggers the default button's click event. Please refer to the below code snippet and the links for more details:

this.textBoxExt1.Multiline = true;
this.textBoxExt1.AcceptsReturn = false;
this.AcceptButton = this.button1;



Please let me know if any concerns.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon