I think the problem comes from the fact that the control is readonly and not disabled. Does it really need to have focus? If so, then you may just need to set the SelectedForeColor and SelectedBackColor of the column's textbox. But doing so may make it difficult to tell which object has focus.
>After running the below code (page's activate), whenever column2 is clicked on with the mouse, the editbox changes from the highlight color to a white background as though it could be edited. It is readonly though. The other columns and controls do not do this. the goal is to have the highlight remain in all columns when the user clicks in the any column and it works for all columns except for the one where I add a control on the fly. I have obviously broken a setting, but is it obvious which one?
>
>
> LOCAL loObject
> loObject = THISFORM.PAGEFRAME.Occupants.GrdMain.Column2
> IF !PEMSTATUS(loObject,'Edit1',5)
> WITH THISFORM.PAGEFRAME.Occupants.GrdMain.Column2
> .REMOVEOBJECT([Text1])
> .ADDOBJECT([Edit1],[EditBox])
> .CURRENTCONTROL = [Edit1]
> .Edit1.VISIBLE = .T.
> .CONTROLSOURCE = "(thisform.ReturnOccAddr())"
> .WIDTH = 340
> ENDWITH
> THISFORM.PAGEFRAME.Occupants.GrdMain.allowcellselection = .F.
> ENDIF
>