WD11: How to apply color changes on field entry

Startbeitrag von Gianni Spano am 28.04.2008 16:33

Hello to all

My request:

During the input of data in a form, i would like to change automatically the background color
of a textbox during its input (ie yellow) and go back to its previous backcolor (ie white) after it exits from the field.

Now i'm using a "ColorOn()" and a "ColorOff()" routines in the "Entry/Exit" section for each field and sincerily this is a bit annoying because i have to write these commands for every textbox in the form (there are a lot of textboxes).

Does anyone know if it is possibile to intercept when the focus is on a textboxes, then execute a global procedure "ColorOn" and when it leaves the field execute a "ColorOff()", without write these functions in the "entry/exit" secton for every field in the forms?

Thanks in advance

Gianni

Antworten:

Hello Gianni

Look at events.


Harry

von harry - am 28.04.2008 17:13
Hi Harry

Thanks for your prompt reply.

I was reading the online help for "Event" and there are few examples available, but nothing to solve my problem, because they are focused only for mouse events and it needs a "Window message" to intercept the "entry" or "exit" event (got focus or lost focus) and i don't know which values they need to be passed in the "Event" declaration.

Please, can you post some example here?

Thanks
Gianni

von Gianni Spano - am 28.04.2008 17:58
***Last Minute ***

Found a solution!!

//Put this code in the Initialization section of the window

nWM_SETFOCUS is int=7
nWM_KILLFOCUS is int=8

Event("ColorOn",".*",nWM_SETFOCUS)
Event("ColorOff",".*",nWM_KILLFOCUS)

It works!!

Gianni

von Gianni Spano - am 28.04.2008 18:08
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.