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.
Unfortunately, activation email could not send to your email. Please try again.

How to set an textboxext didnt allow new line

Thread ID:

Created:

Updated:

Platform:

Replies:

78000 Nov 25,2008 12:47 AM Nov 25,2008 06:49 AM Windows Forms 1
loading
Tags: Tools
Sherly Numawaty
Asked On November 25, 2008 12:47 AM

dear all,

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

many thanks

sherly


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

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;


http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/21977fb2-4c40-4223-8e7d-c3239e4e8f44/

http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox.acceptsreturn.aspx

Please let me know if any concerns.

Regards,
Fathima


CONFIRMATION

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.

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.

;