| Subject: | TCategoryPanelGroup Control position of panel in group added at runtime |
| Posted by: | James Muir |
| Date: | Tue, 30 Dec 2008 |
I am able to create and add a Panel at runtime but it always inserts visually above the last panel.
Thus each panel added inserts itself above the last one created. How can I change the order at runtime?
I tried using exchange method but the visual display remains unchanged.
Simulation of visual display of CategoryGroupPanel:
At application start:
Panel1
Panel2
Panel3
Panel4
Panel5
After Adding Panels 6 and 7 at runtime:
Panel1
Panel2
Panel3
Panel4
Panel7 Added at Runtime
Panel6 Added at Runtime
Panel5
Sample Code I use to create and add a panel:
procedure TForm1.AddDrawers1Click(Sender: TObject);
var
ctgrypnlx: TCategoryPanel;
begin
ctgrypnlx := ctgrypnlgrp1.CreatePanel(self) as TCategoryPanel;
ctgrypnlx.Top := 120;
ctgrypnlx.Height := 148;
ctgrypnlx.Caption := 'Drawer ';
ctgrypnlx.Color := clCream;
end;
Thanks,
Jim