Discussions
Sign In
•
Register
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In with LMD account
Sign In with LMD account
Categories
Recent Discussions
Categories
All Categories
1.1K
NG Controls
28
Announcements
60
LMD IDE-Tools
209
LMD ElPack
373
LMD-Tools
414
Feature Requests
38
In this Discussion
Eugene Balabuev (LMD)
August 2020
IDKOSCH
August 2020
TLMDDockPanel.Create problem
IDKOSCH
August 2020
in
LMD-Tools
Vote Up
0
Vote Down
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
3 Comments
sorted by
Votes
Date Added
IDKOSCH
August 2020
Posts: 13
Vote Up
0
Vote Down
I found it!
i have deleted TLMDDockSite from Form and replaced with a new
TLMDDockSite
and all works well!
Ciao
Stefan
Eugene Balabuev (LMD)
August 2020
Posts: 0
Vote Up
0
Vote Down
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.
IDKOSCH
August 2020
Posts: 13
Vote Up
0
Vote Down
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.
Comments
Stefan