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 ?
This ThisWindow Parent how to use in on key procedure in grid
Moderator: Rathinagiri
Re: This ThisWindow Parent how to use in on key procedure in grid
Use SetProperty function:
SetProperty(ThisWindow.Name, "Label_PressedChar","Value", ch)
SetProperty(ThisWindow.Name, "Label_PressedChar","Value", ch)
Re: This ThisWindow Parent how to use in on key procedure in grid
Thanks Marek !
I understand the example with the Label_PressedChar.Value line. But i am not shure with the Grid_1.CellEx(k,COL_SEARCH) because it has got two parameters (k and COL_SEARCH).
Is this the right syntax ?
setProperty(ThisWindow.Name,"Grid_1","CellEx",k,COL_SEARCH)
Theo
I understand the example with the Label_PressedChar.Value line. But i am not shure with the Grid_1.CellEx(k,COL_SEARCH) because it has got two parameters (k and COL_SEARCH).
Is this the right syntax ?
setProperty(ThisWindow.Name,"Grid_1","CellEx",k,COL_SEARCH)
Theo