Board index » delphi » TEdit and TMaskedit problems ...

TEdit and TMaskedit problems ...

Quote
g4sm...@cdf.toronto.edu (Brian Rampersaud) wrote:
>Hi!
>For the maskedit component, is it possible to remove that unsightly '_'
>underscore character from the editing box?  It says that it can be
>replaced with any character - well, sure, everything but a nice clean
>space - it keeps reverting to the underscore.  Can it be changed without
>modifying the VCL?

The syntax of the editmask is <mask>;{0,1};<display character>.  When
you type your <display character>  make certain you type a space, and
not just delete the '_'.  If you delete the '_' and there is not a
character there, it will default to the underscore.

Quote
>Also, what kind of mask edit would permit actually entering spaces in the
>editing box?  None of the masks seem to provide this (I think).

The lower case "c" will allow spaces

Quote
>As for Tedit, or any control I suppose, how can I suppress the printing
>(output) to control of any character I choose.  Suppose I want the user to
>be able to press the '+' key, but I don't want that to be part of the
>input string.  I know I can just literally remove it from the string, but
>I'd like to trap it before it even gets there.

Try the OnKeyPress event.

Quote
>Thanx in advance,

>                                                bRiAn
>                                UNIVERSITY of TORONTO
>                     human biology & computer science
>                         brian.rampers...@utoronto.ca

Mike Sherrane
sherr...@bluemtn.com                blue mountain software

Our motto: "Work hard,have fun,make money."
(Delphi,Progress,C++, & Rad.  Atlanta, Georgia. 770-875-TECH(8324))
www.bluemtn.com
e-mail: i...@bluemtn.com

 

Re:TEdit and TMaskedit problems ...


Hi!

For the maskedit component, is it possible to remove that unsightly '_'
underscore character from the editing box?  It says that it can be
replaced with any character - well, sure, everything but a nice clean
space - it keeps reverting to the underscore.  Can it be changed without
modifying the VCL?

Also, what kind of mask edit would permit actually entering spaces in the
editing box?  None of the masks seem to provide this (I think).

As for Tedit, or any control I suppose, how can I suppress the printing
(output) to control of any character I choose.  Suppose I want the user to
be able to press the '+' key, but I don't want that to be part of the
input string.  I know I can just literally remove it from the string, but
I'd like to trap it before it even gets there.

Thanx in advance,

                                                bRiAn

                                UNIVERSITY of TORONTO
                     human biology & computer science

                         brian.rampers...@utoronto.ca

Re:TEdit and TMaskedit problems ...


Quote
>  (output) to control of any character I choose.  Suppose I want the user to
>  be able to press the '+' key, but I don't want that to be part of the
>  input string.  I know I can just literally remove it from the string, but
>  I'd like to trap it before it even gets there.

Set keypreview to true and in the keypress event catch these keystrokes that you do not want entered.

johan

Other Threads