我已经为编写允许在此处隐藏组件的组件找到了很多帮助(THIDEPANEL。现在我遇到了第一个问题:
在OnCreate
这个类的事件中,我采用面板的宽度和高度,我想在隐藏/取消隐藏面板时恢复到原始值。实际上隐藏过程总是减小面板的大小
constructor THidePanel.Create(AOwner: TComponent);
begin
inherited;
// The inner panel
WorkingPanel := TPanel.Create(Self);
WorkingPanel.Caption := '***';
// The hide unhide
FActivateButton := TButton.Create(Self);
FActivateButton.Parent := self;
FActivateButton.Caption := '<';
FActivateButton.OnClick := H_ActivateButtonClick;
FActivateButton.Width := BoarderSize;
FActivateButton.Height := BoarderSize;
WorkingPanel.Caption := '';
// Grab the size of the hide panel, later restore to this values
FLargeWidth := Self.Width;
FLargeHeight := Self.Height;
SetButtonPosition(TopRight);
end;