Override method of component in a component.
Posted on 2006-06-19
Ive got this component that im making, which is basically just a regular label, except when you double-click it, it turns into an edit box so that you can edit the caption of the label. Anyways, my component descends from the TCustomLabel, and on the double click, it creates an Edit box, as so:
// FEdit := TEdit.Create(Self.Owner); <-- This is what is created in the constructor of the component....
Self.Visible := False;
FEdit.Left := Self.Left; FEdit.Top := Self.Top;
FEdit.Text := Self.Caption;
FEdit.Parent := Self.Parent;
This works great, except that I want to override the OnKeyDown event of this new edit! So I want to do
FEdit.OnKeyDown := ___________;
except, how would I do that? It seems that I cant just create an event and assign it.... so what do I do?