unit CustomPanelVerpakkingParameter; interface uses Vcl.StdCtrls, Vcl.ExtCtrls, System.Classes, Vcl.Graphics, Vcl.Controls, ApplicationContext; type TCustomPanelVerpakkingParameter = class(TCustomPanel) private FLabelControl: TLabel; FEditControl: TEdit; FProductVerpakkingParameter: TProductVerpakkingParameter; procedure PreparePanel(); procedure CreateControls(); procedure SetProductVerpakkingParameter(Parameter: TProductVerpakkingParameter); public constructor Create(AOwner: TComponent); override; property ProductVerpakkingParameter: TProductVerpakkingParameter read FProductVerpakkingParameter write SetProductVerpakkingParameter; end; implementation constructor TCustomPanelVerpakkingParameter.Create(AOwner: TComponent); begin inherited Create(AOwner); PreparePanel(); end; procedure TCustomPanelVerpakkingParameter.PreparePanel(); begin Align := alTop; Height := 45; Self.ParentBackground := false; Self.Color := clWhite; AlignWithMargins := True; end; procedure TCustomPanelVerpakkingParameter.SetProductVerpakkingParameter(Parameter: TProductVerpakkingParameter); begin CreateControls(); FLabelControl.Caption := Parameter.ProgLabel; FEditControl.TextHint := Parameter.DefaultWaarde; FEditControl.Text := Parameter.Waarde; FEditControl.Hint := Parameter.ToolTip; end; procedure TCustomPanelVerpakkingParameter.CreateControls(); begin FLabelControl := TLabel.Create(Self); with FLabelControl do begin Parent := Self; top := 2; Left := 5; AlignWithMargins := True; // Spacing tussen de controls end; FEditControl := TEdit.Create(Self); with FEditControl do begin Parent := Self; Left := 5; top := 20; width := 70; Constraints.MaxWidth := 70; Anchors := [akLeft]; AlignWithMargins := True; // Spacing tussen de controls end; end; end.