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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fires keypress event of column text1 in grid

Status
Not open for further replies.

koklimabc

Programmer
Jun 17, 2013
49
MY
I'd one problem with grid when I press "Enter Button" in text1 under columns 3 simply doesn't fires anythings because grid doesn't
support keypress event at all.

How to make it to works if I directly define procedure in .PRG ? I'm doing under VFP6.0 not VFP9.0.
and however I don't want add user-define class textbox by using removeobject to remove existing text1 in columns 3 and then addobject with another customised class object
having keypress procedure defined inside class as well.

This code is under my main.PRG :

procedure _screen.activeform.activecontrol.columns(3).text1.keypress
LPARAMETERS nKeyCode, nShiftAltCtrl

if nKeyCode = 13

Wait windows "You have press Enter Button" Nowaits --->How to make it work if place grid's text1 control's procedure at inside .PRG.

endif

Endpro

Appreciate Thankfuls to anyone could help.
 
grid doesn't support keypress event at all.

Yes it does - provided the grid actually contains data (that is, the RecordSource is present).

Although the grid has a keypress, the column doesn't.

If you are not seeing the grid's keypress firing, there must be something else wrong somewhere.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
It's the keypress of the control in the column that fires, not the grid's keypress, I believe.

Tamar
 
What you want to do, program the keypress in a prg and let it be triggered by the grid, would need BINDEVENTS. In VFP6 you have to do a textbox with keypress and replace it in the grid.

Even a FLL craig boyd once did before BINDEVENTS was available depends on VFP7, I think. Besides, his site sweetpotatosoftware.com is taken down.

Bye, Olaf.
 
It's the keypress of the control in the column that fires, not the grid's keypress, I believe.

My understanding is that, if the grid is read-only, the grid's keypress will fire. If the grid is editable, it is the control's keypress that fires.

That would seem logical to me.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top