Error adding component TiSpeedButton derived from TGraphicControl lazarus / 10-Designer ---------------------------------------------------------------------- Borneq · 2009-12-28 17:08 I create two components TiButton = class(TCustomControl) and TiCustomSpeedButton = class(TGraphicControl) I create new project If I want add componet TiButton from palette is OK If I want add componet TiSpeedButton from palette it show warning: "Error setting the name of a component iSpeedButton1:TiSpeedButton to iSpeedButton1" This component on form is invisible bacause has no caption (only is visible if I close and open form) Now I compile and start program Show Debugger Exception Notification "Project project1.exe raised exception class "EClassNotFound" with message: Class "TiSpeedButton" not found" I attach iButtonU.pas file This is Create: (seems normal) constructor TiButton.Create(AOwner: TComponent); begin   inherited;   Color := clNone;   Width := 75;   Height := 26;   TabStop := true;   MouseUpSource := dusMouse;   cButton := TCommonButton.Create(self,Canvas); end; constructor TiCustomSpeedButton.Create(AOwner: TComponent); begin   inherited;   Color := clNone;   Width := 23;   Height := 22;   cButton := TCommonButton.Create(self,Canvas); end; ---------------------------------------------------------------------- Borneq · 2009-12-29 07:40 I solve this problem: when calls messages like CM_MOUSEENTER,CM_MOUSELEAVE or component changed call Invalidate for parent control: InvalidateRect(Parent.Handle,@R,false); Are two solution: 1.no InvalidateRect if (csDesigning in ComponentState) 2.no InvalidateRect if (Parent=nil) or (not Parent.HandleAllocated)