THidepanel的開發仍然給我帶來許多問題。我遵循這裏給出的指示Other Help and Questions差異設計和運行時間
我設計了內部面板現在有一個紅色的顏色和外部面板有點小。如果我在測試應用程序中運行組件,則僅繪製外部面板,並且放置在內部工作面板上並且在設計時可見的所有組件都不再可見。
我認爲錯誤如下:outedr面板被繪製爲最後一個動作,因此在運行時我看不到紅色的內部面板和放置在這裏的組件? 這是真的,哪裏是我的假設錯了,我應該怎麼做才能解決這個問題
最新創建功能爲我的組件來這裏:
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;
問題是什麼。並且請以更標準的方式格式化您的代碼。所有的空白都很煩人。例如,使用IDE中的格式源選項。 – 2013-04-10 20:44:30
Franz,請注意*寄宿生*和*邊界*之間的區別。後者指的是某物的邊緣,而前者指的是某人支付你在你家中睡覺並吃掉你的食物。 – 2013-04-10 20:59:46
弗朗茨,我必須爲我提出的方法表示歉意,.dfm將不能存儲放置在工作面板上的組件,因此第二個建議可能是需要的實現。 – bummi 2013-04-10 22:00:11