This ThisWindow Parent how to use in on key procedure in grid
Posted: Mon May 16, 2016 10:03 am
I frequently use the incremental search functionality in my programs based on the sample:
..\SAMPLES\Controls\Grid\GridIncrementalSearch
Now each time i use this functionality i need to create a ON KEY procedure ( like the Proc_GridSearchString() in the sample).
But most of the time the ON KEY procedures are more or less the same. Only the From name and the Grid name changes ( in the example Form_1 and Grid_1 ).
So i tried to change the ON KEY procedure without specific grid and form names using the This and ThisWindow but without success.
For example change
Form_1.Grid_1.CellEx(k,COL_SEARCH)
in
This.CellEx(k,COL_SEARCH)
Or
Form_1.Label_PressedChar.Value := ch
in
ThisWindow.Label_PressedChar.Value := ch
This seems not the way to go, but is there another solution ?
..\SAMPLES\Controls\Grid\GridIncrementalSearch
Now each time i use this functionality i need to create a ON KEY procedure ( like the Proc_GridSearchString() in the sample).
But most of the time the ON KEY procedures are more or less the same. Only the From name and the Grid name changes ( in the example Form_1 and Grid_1 ).
So i tried to change the ON KEY procedure without specific grid and form names using the This and ThisWindow but without success.
For example change
Form_1.Grid_1.CellEx(k,COL_SEARCH)
in
This.CellEx(k,COL_SEARCH)
Or
Form_1.Label_PressedChar.Value := ch
in
ThisWindow.Label_PressedChar.Value := ch
This seems not the way to go, but is there another solution ?