This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.

TLMDDockPanel.Create problem

Hi, 
this code creates a TLMDDockPanel:

var
  pnl: TLMDDockPanel;
begin
  pnl := TLMDDockPanel.Create(Form1);
  if pnl.Zone <> nil then
  begin
    pnl.Zone.Index := pnl.Zone.Parent.ZoneCount - 1;
   .....

but pnl.Zone is always nil !

What can i do?

Ciao
Stefan

Comments

  • I found it!

    i have deleted TLMDDockSite from Form and replaced with a new TLMDDockSite and all works well!

    Ciao
    Stefan
  • The code above should not work anyway. You've created a panel, but since it not docked anywhere yet, it's Zone property will (and should) return nil. You have to dock it using Site.DockControl method before using panel's Zone.
  • i forgot to say;

    after my 
       pnl := TLMDDockPanel.Create(Form1);
    i use 
        DockAsTabbedDoc(pnl);

    procedure TFormMain.DockAsTabbedDoc(APanel: TLMDDockPanel);
    var
      zn: TLMDDockZone;
    begin
      zn := Site.SpaceZone;
      while (zn <> nil) and (zn.Kind <> zkTabs) and (zn.ZoneCount > 0) do
        zn := zn[0];
      if zn <> nil then
        Site.DockControl(APanel, zn, alClient);
    end;

    but there was Site.SpaceZone always nil!

    After replacing the TLMDDockSite Site.SpaceZone is not nil and all works fine...

    Ciao
    Stefan
Sign In or Register to comment.