问题
I have a project with some 3rd-party controls in it. I have a TextEdit and a MemoEdit in my form and I want to limit the number of characters that the user can enter.
回答1:
You can wait for the newest version but there are a few workarounds such as masking, helper properties and/or character counting on the text changed event. Here are some links to the workarounds:
Mask workaround: http://www.devexpress.com/Support/Center/p/Q250641.aspx
Helper property workaround: http://www.devexpress.com/Support/Center/p/S131769.aspx
Text change/char count: http://www.qtcentre.org/threads/6776-Text-edit-and-maxLength
来源:https://stackoverflow.com/questions/12467674/limit-the-input-length-of-a-devexpress-textedit-and-memoedit-controls