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.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

38384 Dec 12,2005 12:37 AM Dec 15,2005 06:07 AM Windows Forms 2
loading
Tags: Tools
Limy
Asked On December 12, 2005 12:37 AM

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 04:27 AM

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

NodesLabel.zip

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

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

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.

;