PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Input Mask Question
Input Mask Question
Iniciado por guest, 08,ago. 2015 09:57 - 3 respuestas
Publicado el 08,agosto 2015 - 09:57
Hello Everyone,

I must be very stupid, but I can't find a way to define an InputMask for an EditControl, preventing the user to enter spaces.
For example, when a users enters "the summer", he may not be allowed to do this, and the space between the and summer must be removed automaticly when the user presses the spacebar.
I know how to do it after everything is entered, but I want to do it at the time when the user is entering text.
Any suggestions for me ?

grtz,

Patrick
Publicado el 08,agosto 2015 - 11:35
Hi Patrick, I wouldn't do this by using a mask. In "whenever modifying ..." you can retrieve the actual cursor position and look whether the character left of it is a space or not. If so then delete it or replace it with an undersore character and if deleted then set cursor position one to to left (curor - 1) if position > 1.
Publicado el 08,agosto 2015 - 12:34
Hi,

click on the control. description appears for this control . select in tab general :
type = tekst
unput mask uppercase letters+ digits .

Then space does nothing

regards
Allard
Publicado el 11,agosto 2015 - 00:06
Hi,

in the windows init put the following

nkey is int = 0x20 // this is space ascii code

in the modification section of the textbox put the following code

IF KeyPressed(nKey) THEN // if space is pressed
SendKey("{RIGHT}"+"{BS}") // send cursor to right of the textbox and do backspace
END