Change te picture of a get according the contents

Change te picture of a get according the contents

Postby Willy » Sun Apr 23, 2006 10:20 am

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
Willy
 
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Postby James Bott » Mon Apr 24, 2006 5:25 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Willy » Wed Apr 26, 2006 8:08 am

Thanks James,

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

Thanks for the advice.

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

Postby Vladimir Grigoriev » Wed Apr 26, 2006 10:29 am

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

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

Postby DanielPuente » Sun Apr 30, 2006 7:31 am

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
DanielPuente
 
Posts: 108
Joined: Sun Oct 09, 2005 6:12 pm
Location: Mar del Plata - Argentina


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 26 guests