for i = 1 to this.ColumnCount with this.Columns(i) .AddObject('Text2','MyTextBoxClass') && 'MyTextBoxClass' is a class name of your textbox class .Text2.Visible = .T. .CurrentControl = 'Text2' .Text1.Visible = .F. .RemoveObject('Text1') .Text2.Name = 'Text1' endwith endforThan in the class call some generic method of the form, for example
* click event of textbox class if PEMSTATUS(thisform,'GridClick',5) && check if method exists thisform.GridClick(this) endifFinally, create custom method on the form and put your code for clicks in grid there. Note that in my sample reference to textbox object is passed to the GridClick method to identify the column clicked (you can remove this if not needed).