12-28-2013 12:30 AM
Hi there,
I need a control for the user to input some string with only alphabets and no special characters. Also need to control the number of characters to input. I search it and see someone use Xcontrol to achieve that but I really have no idea how to get that. Any other way to get this function works on string input?
12-28-2013 01:13 AM - edited 12-28-2013 01:20 AM
Set the string to "single line" and "update while typing". Use a filtering key-down event and discardunwanted characters of characters past the max length.
(Make sure not to filter edit keys, such as backspace, etc.)
(look at my very old example for ideas.)
12-28-2013 02:21 AM
@altenbach wrote:
Set the string to "single line" and "update while typing". Use a filtering key-down event and discardunwanted characters of characters past the max length.
(Make sure not to filter edit keys, such as backspace, etc.)
(look at my very old example for ideas.)
Thanks a lot. But that's works on in run time not in edit mode, right?
12-28-2013 02:29 AM
You did not specify edit mode functionality. If you need that, you need to build an x-control.
12-28-2013 03:11 AM
@altenbach wrote:
You did not specify edit mode functionality. If you need that, you need to build an x-control.
my bad. It seems that x-control is the only way to achieve that. I don't know how to program x-control, I found two examples online but it seems that we need to create the appearance ourselve. Is it possible to inherit the control for built-in string or slive string and modify the behavior to get that. I want to keep all controls the same appearance.
12-28-2013 03:18 AM
You have full control over the appearance of the x-control. I don't understand your concern.