Jump to content

help with mask


Recommended Posts

how to put a mask on the field or numeric Uniedit unidbedit ?

If you are referring to mask keystrokes, go to the properties of UniEdit, choose ClientEvents property and edit ExtEvents. Go to OnBeforerender event and add the mask you need using maskRe property of the ExtJS's TextField component. Here is an example for alfa keystrokes only:


function OnBeforerender(sender)




Link to comment
Share on other sites

Good morning!

In Delphi I use this routine to make an edit to the same bank ATMs.

TForm1.Edit1KeyPress procedure (Sender: TObject; var Key: Char);


if not (Key in ['0 '.. '9', # 8, # 9]) then

key: = # 0;

/ / Function to position the cursor always on the right

Edit1.SelStart: Length = (Edit1.Text);



then the change type well



s: string;

v: double;

I: integer;


/ / Step 1: If the edit is empty, nothing can be done.

If (= Edit1.Text emptystr) then

Edit1.Text: = '0, 00 ';


/ / Step 2: get the text edit WITHOUT a comma and WITHOUT the decimal point:

s: ='';

for I: length = 1 to (Edit1.Text) of

if (Edit1.Text in ['0 '.. '9']) then

s: = s + Edit1.Text ;


/ / Step 3: make edit the contents of the present two decimal places:

v: = strtofloat (s);

v: = (v / 100) / / to create two decimal places


/ / Step 4: Format of the value (V) for accepting values ​​of the type 0.10.

Edit1.Text: FormatFloat = ('# # #, # # 0.00', v);

edit1.SelStart: = 0;



is how to do this uniedit???

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...