Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Restricting TEdit Input?
Mon, May 14 2012 4:58 PMPermanent Link

Mark Brooks

Slikware

Avatar

Hi All,

I want to restrict the characters that can be entered into a TEdit. I had thought that OnKeyDown or OnKeyPress might be the appropriate place to do this. Perhaps by returning False when an invalid key is entered or setting a parameter to #0 rather than the character code of the key. However nothing that I do seems to have the desired effect. Has anybody else had success with this yet?

Regards
Mark
Wed, May 16 2012 1:07 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mark,

<< I want to restrict the characters that can be entered into a TEdit. I had
thought that OnKeyDown or OnKeyPress might be the appropriate place to do
this. Perhaps by returning False when an invalid key is entered or setting a
parameter to #0 rather than the character code of the key. However nothing
that I do seems to have the desired effect. Has anybody else had success
with this yet? >>

This seems to be an issue with IE8 or lower.  I'm investigating a
work-around, but don't have anything yet.

I'll let you know what I find out.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Feb 20 2013 5:04 AMPermanent Link

Matthew Jones

This is perhaps old, but I too am wanting to edit the characters allowed. And
indeed, to auto-capitalise the letters. Given no Var parameters, it looks like the
way forward is going to be to return False to the OnKeyPress (or Down) and then to
manually change the text. That messes up editing though with the cursor.

If there is a way to restrict the input characters somehow (probably to a "valid"
character string to be easiest), and to auto-uppercase or -lowercase then that
would be nice. But mainly some way to control the actual character chosen so we
have control. Not urgent, but would be good.

/Matthew Jones/
Fri, Feb 22 2013 12:05 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< If there is a way to restrict the input characters somehow (probably to a
"valid" character string to be easiest), and to auto-uppercase or -lowercase
then that would be nice. But mainly some way to control the actual character
chosen so we have control. Not urgent, but would be good. >>

This would have to be a version 2, at the very least.  If I introduce var
parameter functionality (if it can be done efficiently), then we're talking
about changing a lot of event handler declarations in existing projects.

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Image