[TMaskEdit] Edit or EditText lazarus / 31-LCL ---------------------------------------------------------------------- bdexterholland · 2011-12-06 14:37 Hi folks! Which property should i use to get the real typed text on a TMaskEdit, Edit or EditText? ---------------------------------------------------------------------- Bart · 2011-12-06 22:26 That all depends on what you mean by "real typed text". EditText holds the text as you see it in the control, including the character used as spacechar (by default an underscore ('_')). Text is the text with SpaceChar replaced with spaces (#32) and depending if Masknosave is specified in the mask all maskliterals are removed and the text is trimmed either left or right (again depending on the editmask). See the source of maskedit.pp. Example: Code: [Select]  Maskedit1.EditMask := '999.999.999.999;1;_';  //mask for IP-address perhaps? Now if you type 128.254.192.1 in the control then Text will be '128.254.192.1  ' EditText will be '128.254.192.1__' Bart ---------------------------------------------------------------------- bdexterholland · 2011-12-07 01:12 as you said, it becames usefull for IP address but i wanna use it for personal documents. i've created a mask 000.000.000-00;0;_ but i don't wanna get all mask chars, only the user's typed chars. Today, with my difficult to understand how it works, i create a function that returns only the numbers of the text. It's something like this: Code: [Select]Function RemoveUnecessaryCharsFromCPF(CPF : String) : String; var   aux : string;   i : Integer; begin   aux := EmptyStr;   for i:= 1 to length(CPF) do     if (CPF[i] in ['0'..'9'] then       Aux := Aux + CPF[i];   Result := Aux; end;Is there any way to make MaskEdit return the text as i need, making unecessary to use this function? ---------------------------------------------------------------------- Bart · 2011-12-07 13:29 You can use a mask like '!999.999.999.999;0;_' Now Text will hold only the numbers (and spaces between numers if they exist), without the periods, and left-trimmed (maybe right-trimmed, I didn't test, and I don't know by heart). Just try playing around with different editmasks and see how Text and EditText behave. I'll attach a sample MaskEdit test suite I use for development. Just play with it. For your purpose, in the end you may end up not using a maskedit at all. Bart ---------------------------------------------------------------------- bdexterholland · 2011-12-07 14:42 thanks! it solved my issue...