My grid's dblclick event is working fine. It returns the recno() of the current row and then set's it's own visiblity to .f.. The grid disappears.
I want the Enter key to do exactly what the dblclick code does so I put this in the Keypress event of the grid
The Keypress causes all the dblclick code to execute but some elements of the grid remain on the screen; specifically the column header bar, the record selector column, the row border lines, the scroll bars and the row I just selected in highlight color. Everything but column lines and data and text.
Even if I put
this.visible=.f.
in the Keypress code, the grid remnants are still there.
BTW when I "call" the grid I set it's zorder(0) to put it on top of other controls in the form. Here's the "calling" code in a method of the form:
Like I said, it works beautifully when dblclicked with the mouse, but leaves the remnants when Enter key is used.
Any idea why?
Thanks to all who bother to reply to my many recent posts. I keep looking to return the favor in the VFP forums but haven't seen any where I knew the answer first. Will keep looking.
I want the Enter key to do exactly what the dblclick code does so I put this in the Keypress event of the grid
Code:
If nKeyCode = 13
this.dblclick()
endif
The Keypress causes all the dblclick code to execute but some elements of the grid remain on the screen; specifically the column header bar, the record selector column, the row border lines, the scroll bars and the row I just selected in highlight color. Everything but column lines and data and text.
Even if I put
this.visible=.f.
in the Keypress code, the grid remnants are still there.
BTW when I "call" the grid I set it's zorder(0) to put it on top of other controls in the form. Here's the "calling" code in a method of the form:
Code:
thisform.LockScreen = .T.
zap in (thisform.grdvoters.recordsource)
<<do stuff here to refresh the grid's recordsource cursor>>>
select (thisform.grdvoters.recordsource)
append from dbf( [crsTemp] )
go top in (thisform.grdvoters.recordsource)
thisform.grdvoters.refresh()
thisform.grdvoters.setfocus()
thisform.grdvoters.top=((thisform.nCurrentRow-1)*75)+165
thisform.grdvoters.zorder(0)
thisform.grdvoters.visible=.t.
thisform.LockScreen = .F.
Like I said, it works beautifully when dblclicked with the mouse, but leaves the remnants when Enter key is used.
Any idea why?
Thanks to all who bother to reply to my many recent posts. I keep looking to return the favor in the VFP forums but haven't seen any where I knew the answer first. Will keep looking.