Nishit,
I think I know what's wrong. When you do an AddObject(), the obejct's Visible default to .F. You have to explicitly set it to .T. Here's the sample I used :-
* Class Definition myTextBox OF Test.VCX:-
* myTextBox.KeyPress() :-
MESSAGEBOX('KeyPress EVent')
* myTextBox.DblClick() :-
MESSAGEBOX('DblClick Event')
* Form MyForm1.cmdReplControl :-
SET CLASSLIB TO Test.VCX
WITH THISFORM.Grid1.Column1
.RemoveObject('Text1')
.AddObject('Text1','myTextBox')
.Text1.Visible = .T.
ENDWITH
Kenneth.
>Hi Kenneth,
>
> Thanks for reply. I tried that also, but not working. Can u know how to add/write event at runtime. Or specify event at runtime? May be this will work. I am using that textbox for other controls and it works fine. but not with grid.
>
>regards
>amit
Kenneth.