Change te picture of a get according the contents

Post Reply
Willy
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Change te picture of a get according the contents

Post by Willy »

Hello,

A Belgium bank nr always have the same picture.
999-9999999-99

Sometimes the client is from another country and has a bank nr with another picture.

How can I change the picture of the field when the window is running.

The idea is to start all nrs with "BE"

So the picture will be :

"!!-999-9999999-99"

where the first 2 characters will be by default "BE"

When the get got focus the position of the cursor should be 4.

When the content of the first 2 characters is "BE" the picture should have to be "!!-999-9999999-99"
Otherwise the picture should be "!!-xxxxxxxxxxxxxxx"

Does anybody have an idea how to fix this.

Thanks

Willy Hermans.

Thanks,

Willy
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

You could try using ON CHANGE and changing the picture (oGet:oGet:cPicture).

But I would just let the user type in whatever they want, then post process it to put it in the correct format and put it back into the GET. If it doesn't appear to be valid data, then you can turn the background a different color to signify that the data is invalid.

James
Willy
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Post by Willy »

Thanks James,

I have tried it this way, and indeed this is a better way.

Thanks for the advice.

Willy.
Vladimir Grigoriev
Posts: 54
Joined: Fri Oct 21, 2005 10:45 am
Location: Russia, Moscow
Contact:

Post by Vladimir Grigoriev »

Maybe you should use ComboBox (or other control) to let a user select approciated picture format himself?

Vladimir Grigoriev
DanielPuente
Posts: 108
Joined: Sun Oct 09, 2005 6:12 pm
Location: Mar del Plata - Argentina
Contact:

Post by DanielPuente »

Vladimir:

You can change the get picture whenever you want with:

IF CRUB==1
oPuni:oGet:Picture:='999,999.9999'
oPuni:Refresh()
ELSE
oPuni:oGet:Picture:='999,999.99'
oPuni:Refresh()
ENDIF

Regards,
Daniel Puente
Mar del Plata, Argentina
danielpuente@speedy.com.ar
puenteda@hotmail.com
Post Reply