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

way to limit the number of character the user may type for a label

Thread ID:





38384 Dec 12,2005 05:37 AM UTC Dec 15,2005 11:07 AM UTC WinForms 2
Tags: Tools
Asked On December 12, 2005 05:37 AM UTC

Hi all, I wanna know whether i can restrict a user from entering characters beyond a limit in a label. Using NodeEditorValidating handler will help me to know the length of the text and throw an error messege when the user attempts to enter a character beyond the preset limit. But i feel it would be even better if i can use a property to do this job. Thanks in advance. Regards, Limy

Deepa TS [Syncfusion]
Replied On December 12, 2005 09:27 AM UTC

Hi Limy, You could use the following code snippet in the NodeEditorValidateString event to restrict a user from entering characters beyond a limit in a LabelEditing. private void treeViewAdv1_NodeEditorValidateString(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvCancelableEditEventArgs e) { if(e.Label.Length<=5) e.ContinueEditing=true; else e.Cancel=true; } Please take a look at the attached sample. And let me know if this meets your requirement. Thanks for your patience and interest in Syncfusion products. Regards, Deepa.T.S


Administrator [Syncfusion]
Replied On December 15, 2005 11:07 AM UTC

Hi Deepa, Its workin fine. Thanks a lot. Regards, Limy


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