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.

MaskedEditBox Preset input Text problem

Thread ID:

Created:

Updated:

Platform:

Replies:

9058 Dec 3,2003 11:53 PM Dec 5,2003 03:31 PM Windows Forms 5
loading
Tags: Tools
Ralf Huettl
Asked On December 3, 2003 11:53 PM

Hi all, if we define a mask in the MaskedEditBox the user input is no problem. But how can we reset a user input that the mask will work again. Example Mask: PF:&&&&& The user puts in: PF:12345 If the user reenters the form (anytime) and we prefill the Text-Property then there is: PF:PF:12345 Did we have to parse every Box for cutting and pasting the user input correctly? That would be much work to do so for every different kind of Mask... ? Thank you for helping out Ralf

Gurucharan Patwal [Syncfusion]
Replied On December 4, 2003 07:31 AM

Hi Ralf, Yes, I see this problem. The workaround for the time being would be to parse the Mask of each MaskedEditBox and trim the Text property value appropriately. I have attached a sample application that illustrates this workaround : Sample_Application The Mask used in this sample is PF:&&&&&. I have informed the Essential Tools development team regarding this issue and will update with their inputs on this one. We appreciate your feedback, and thanks for your patience. Regards, Guru Patwal Syncfusion, Inc.

Gurucharan Patwal [Syncfusion]
Replied On December 4, 2003 09:12 AM

Hi Ralf, A better workaround for this problem would be to use the ClipText property of the MaskedEditBox to save the old text value. The reason being - MaskedEditBox only applies text set through the Text property to the Mask positions and not the literal positions. If you change the sample to set the ClipMode to ExcludeLiterals or change this line to this.oldvalue = this.maskedEditBox1.ClipText; it would work as expected. I have attached the modified version of my earlier sample application here : Sample_Application_Modified Please try this and let me know if it helps. Regards, Guru Patwal Syncfusion, Inc.

Ralf Huettl
Replied On December 4, 2003 11:26 AM

Hi Guru, this is a nice workaround but if we allow prompt input (or in our case input of spaces) then the spaces are deleted because this is a literat (ExcludeLiteral). The second problem is if the mask is more complex like PF:&&&&:&&&&-&&&&& these workaround is not working. We must parse every input manually then it works for us. But there hast to be be a formatText to save the user input with the mask correctly. It is not hard to develop (maybe with xml or regular expression grammar) Greetings :-) Ralf

Gurucharan Patwal [Syncfusion]
Replied On December 4, 2003 03:52 PM

Hi Ralf, Thanks for your feedback. The maskedEditBox1.ClipText workaround works fine even for complex masks like PF:&&&&:&&&&:&&&&&, but it does not handle blank spaces well. I will further investigate this issue and update you at the earliest. Thanks for your patience. Regards, Guru Patwal Syncfusion, Inc.

Gurucharan Patwal [Syncfusion]
Replied On December 5, 2003 03:31 PM

Hi Ralf, To handle empty spaces within the text in the MaskedEditBox, the PaddingCharacter property has to be set to a single space character - '' ''. However, there was a bug in the ClipText property that did not return empty mask positions filled with the PaddingCharacter. This has now been taken care of in the source code internally, and the bug fix is expected to be included in the next build of Essential Suite. Thanks for your cooperation, and we appreciate your feedback on this issue. Regards, Guru Patwal Syncfusion, Inc.

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.

;