Franz
Franz

Reputation: 2047

Difference Design and run Time

THidepanel development is still putting many questions to me . I followed the instructions given here Other Help and Questions

I designed the inner panel now to have a red color and be a bit smaller as the outer panel. If I run the component in a test application only the outer panel is drawn and all components placed on the inner working panel and beeing visible at design time are no longer visible.

I assume the bug to be the following : the outedr panel is drawn as a last action and therefore at runtime I can not see the red inner panel and the components placed here? Is this true, where is my assumption wrong, what should I do to fix this problem

The latest Create function for my component comes here :

constructor THidePanel.create(aOwner: TComponent);
begin
  inherited;

  padding.Left:= BorderSize;
  padding.top:= BorderSize;
  padding.right:= BorderSize;
  padding.Bottom:= BorderSize;



  //  the inner panel
  WorkingPanel := TPanel.create(self);
  WorkingPanel.Caption := ' ';
  WorkingPanel.BevelOuter := bvNone;

  // WorkingPanel.BringToFront;

  WorkingPanel.Color :=220;
  WorkingPanel.ParentColor := false;
  WorkingPanel.Parent := self;
  WorkingPanel.Align := alClient;

  //  the button to mimimize / maximize
  FActivateButton := TButton.create(self);
  FActivateButton.Parent := self;
  FActivateButton.Caption := '<';
  FActivateButton.OnClick := H_ActivateButtonClick;
  FActivateButton.Width := BorderSize;

  FActivateButton.Height := BorderSize;


  ///   the restore values , correct setting
  FLargeWidth := self.Width;
  FLargeHeight := self.Height;
  FHasCustomSize := false;

  // here I draw the activate button on the outer panel
  SetButtonPosition(topright);


  //  drop components only on the inner panel
  ControlStyle := ControlStyle - [csAcceptsControls]

end;

DESIGN AND RUN TIME ISSUES

not vivible components at run time

Upvotes: 0

Views: 300

Answers (1)

dthorpe
dthorpe

Reputation: 36082

Try setting WorkingPanel.Visible to True.

Upvotes: 1

Related Questions