Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextBox.DblClick in Grid 2

Status
Not open for further replies.

SleepDepD

Programmer
Mar 13, 2004
65
US
I can't get the DblClick event for a TextBox in a Grid to trigger. My project uses custom Grid and TextBox classes developed by someone else who's no longer on the project and I'm trying to add double-click functionality to the grids. I've used the Coverage Profiler and the DblClick event is simple NOT happening.

The custom TextBox class doesn't have very much code in it that could be causing problems; there is a NODEFAULT at the end of the GotFocus event--which I've tried removing (and replacing with a DoDefault() ), but that didn't help. The Click event has some code, I tried adding a DoDefault() to the end but that didn't help either.

I assume I'm missing something...I'd appreciate any help.

...SLeeP-DeP'd
 
What version of VFP? In VFP8 AllowCellSelection has to be .T. for controls in the grid to get the focus. Also, I've seen cases where a double click goes to the click event twice.

Regards,

Mike
 
VFP7.

hmmm...looking at the log from the Coverage Profiler again, the Click event is happening twice...I wonder if I can semi-easily do something using that.

...SLeeP-DeP'd
 
Try this in the click event.
Code:
IF INKEY(_dblclick,"MS") = 151
   THIS.DBLCLICK
ENDIF
_dblclick is a windows variable for mouse double click timing. 151 is the return code if INKEY() was terminated by a mouse click.

Regards,

Mike
 
mspratt,

Wow! That worked! Thanks a lot.

...SLeeP-DeP'd
 
You're welcome. Glad you got it working.

Thanks for the star:)

Regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top