Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 2 Jahren, 1 Monat
Letzter Beitrag:
vor 2 Jahren, 1 Monat
Beteiligte Autoren:
StefanoG, Arie, Fabrice Harari

manage events on several table columns once

Startbeitrag von StefanoG am 30.12.2015 20:41

I was tring a way to write the code of an event on table columns once instead of copying the procedure (the call of a procedure if it is more than 2 rows of code) inside the code in response to the same event on N columns of a table. Unfortunately I cannot succeed in this task. Did anyone succeded in archieving this?

Example: I have a table control "TABLE_Person" with 20 editable columns:
COL_name, COL_surname, COL_address, COL_city, COL_zipcode, COL_age and so on...

If I want to execute the simple code MySelf..Value = MySelf..Note for the "Entry" or "Exit" event for each column the user can edit. Now I need to put that code in the event of COL_name and copy it the same for all the other columns.
Final result... N columns = N copy of that code

Thank you.


Hi Stefano,

first, myself..anything will work only in the code of the column...

Second, you can use a procedure call that you put in each column and send to it as a parameter myself..name, then in yor procedure, you use indirection to work on any column the code is calling from.

Finally, you can try and see if entering a column and exiting a column trigger a specific "event". If it's the case, you can interecept it and put your code there

Best regards

von Fabrice Harari - am 31.12.2015 11:52
Thank you for the answer.
This - being an expert like you to sayd that - confirms I can't do nothing more than what I'm doing now to manage this feature.
Currently I already call function "LP_ColEntry", "LP_ColExit" and so on to unify the management of columns. I could put them in a class not to having copy of them inside each form but I cannot call them once for a "generic column" of the table. N columns = N calls.

So no way to escape from that.

von StefanoG - am 31.12.2015 13:50

maybe an event is fired whenever you enter/exit a column?


See the help for the proper format of "your_proc".
You will get all events on TASBLE_Person, which can be quite a lot events you don't want, (like draw and mousemove) but with some tracing maybe you fill find the events you need.
If so you have one procedure to handle all columns.

von Arie - am 31.12.2015 14:16
Yes, already tried even this way.
Unfortunately there is no specific event on entry/exit of a column...
It reminds me the headache when tring to do the same to implement sorting on table columns header double-click instead of native single-click sort.

von StefanoG - am 31.12.2015 15:33
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.