I have a composite component consisting of TEdit and TButton (yes, I know about TButtonedEdit ) that inherits from TCustomControl . Editing and a button are created in its constructor and placed on it.
At design time, the selection box is not drawn correctly - I assume that the edit button hides it because it was drawn for a user control and then dragged them.
Here's a comparison:

I also saw this for other third-party components (for example, TcxGrid also draws only the outside of the selection indicator)
Question: How can I change this?
The easiest case to play:
unit SearchEdit; interface uses Classes, Controls, StdCtrls; type TSearchEdit = class(TCustomControl) private fEdit: TEdit; public constructor Create(AOwner: TComponent); override; end; procedure Register; implementation procedure Register; begin RegisterComponents('Custom', [TSearchEdit]); end; { TSearchEdit } constructor TSearchEdit.Create(AOwner: TComponent); begin inherited; fEdit := TEdit.Create(Self); fEdit.Parent := Self; fEdit.Align := alClient; end; end.
source share