Hi, I have tried your sample, and I found the same (in D7). I think the guilty is the StringGrid descendant, who is the parent of the TEdit. It steal the Change message from the Edit. You can use the OnKey.... events (it is so ugly), or (more confortable) the TInPlaceEdit descendant instead the TEdit. In the TInPlaceEdit descendant you can override the protected methods: UpdateContents, Click, DblClick as you wish.
regards.: m. ----- Original Message ----- From: "CubicDesign" <[EMAIL PROTECTED]> To: <delphi-talk@elists.org> Sent: Thursday, November 16, 2006 1:13 PM Subject: Bug in Delphi? > *Dear List * :) > > I created my own custom TStringList VCL and now I want to add a better > editor to it. I want to let the user to enter the text in a TEdit > control, positioned right above the cell. > For this, I want to create at run time a TEdit control. All is nice and > beautiful until I want to assign an event to TEdit.OnChange. It does not > assign: > > > TYPE > TBGrid= class(TStringgrid) > Private > ... > protected > Editor: TEdit; { Custom InPlace Editor in StringGrid } > End; > > > constructor TBGrid.Create; > begin > inherited Create(AOwner); > Editor:= TEdit.Create(Self); > Editor.Parent := Self; > Editor.OnChange := Edit2Change; <- this is working > Editor.OnClick := Edit2Change; <- doesn't assign > bla bla bla > End; > > > procedure TBGrid.Edit2Change(Sender: TObject); > begin > Bip(5000, 200); > end; > > > > I put the StringGrid on a form, I run the program. The Editor shows. > If I click on it, it beeps. If I type a char in it, it does not beep. > > > > __________________________________________________ > Delphi-Talk mailing list -> Delphi-Talk@elists.org > http://www.elists.org/mailman/listinfo/delphi-talk > > __________________________________________________ Delphi-Talk mailing list -> Delphi-Talk@elists.org http://www.elists.org/mailman/listinfo/delphi-talk