And override the Edit method and HasEditor method in the TIDEComponentEditor descendant:
Rough example from TImageList editor:
type
TImageListIDEEditor = class(TIDEComponentEditor)
protected
procedure Edit; override;
function HasEditor: boolean; override;
end;
procedure TImageListIDEEditor.Edit;
begin
if GetComponent is TImageList then
EditImageList(TImageList(GetComponent));
end;
function TImageListIDEEditor.HasEditor: boolean;
begin
result := true;
end;
RegisterIDEComponentEditor(TImageList, TImageListIDEEditor);
When MainForm.Show is called, the form is displayed and the script is finished. Aren't you maybe destroying objects after the script is "finished"? Then you are destroying the event handlers from the form.