On Tue, 04 Mar 2014 17:19:23 +0200 FreeMan <freema...@delphiturkiye.com> wrote:
> ExLookUp1:=TExLookUp.Create(Form1); This is for manual creating, I showed you the corresponding code on how a designed component is created, so you can see the order. > I'm > talk about, I'm designing in IDE, 1-2 TExLookUp on form, and run my > application, TExLookUp is class(TCustomEditButton) so Edit and button is > shown on where I put on form, in designtime IDE. > > constructor TExLookUp.Create(AOwner: TComponent); > begin inherited Create(AOwner); > Self.OnChange := @EditChange; > FGrid := TRxDBGrid.Create(Self); > FGrid.Parent := Self.Parent; > FGrid.Left := Self.Left; > FGrid.Top := Self.Heigh + 10; > FGrid.Width := 150; > FGrid.visible := False; I now see, that you are creating the Grid as neighbor of TExLookUp. Then my prior mail was wrong and you can use the following rules to position the FGrid below TExLookUp: FGrid.AnchorParallel(akLeft,0,Self); FGrid.AnchorParallel(akRight,0,Self); FGrid.AnchorToNeighbour(akTop,0,Self); Keep in mind that Parent is not yet set in the constructor. You should override the method SetParent, so that each time ExLookUp.Parent is changed the FGrid.Parent is changed as well. >[...] > > The order of setting properties is arbitrary. Your component should work > > with any order. > > Sorry, but I'm scared this answer, because nothing my under control It means for example Left:=3; Width:=10; or Width:=10; Left:=3; or Left:=30; Width:=10; Left:=3; Writing a control that works in others people programs is more complicated. You need to override more methods. Mattias -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus