Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

How to create a floating DockPanel programatically

Hi!

Is there an example on how to create a floating dock panel?
Currently I'm trying this code, which almost works:

FloatingForm := TLMDFloatingForm.Create(Application);
DockPanel := TLMDDockPanel.Create(FOwnerForm);
FloatingForm.Site.DockControl(DockPanel);

The only problem I have is, that the floating panel is hiding behind the main form when clicking on the main form.
When I dock the panel to the dock site in the main form and then undock again, the floating panel stays on top.

What am I doing wrong?

Thanks in advance

Jochen.

Tagged:

Comments

  • 3 Comments sorted by Votes Date Added
  • You should use standard Delphi's ManualFloat method (e.g. MyPanel.ManualFloat(...)), instead of creating TLMDFloatingForm explicitly.
  • ManualFloat works, but still the same problem.

    With the help of LMD support and some additional tests I found the problem:


    When creating
    und undocking a TLMDDockPanel in FormCreate of the main form the dock panel
    will hide.

    When creating
    and undocking a TLMDDockPanel in FormShow, everything works as expected.

  • Yes, this is because in VCL main form should be fully created first. VCL use main form's handle to specify owner (in Windows terms) for other forms, including LMD DockingPack floating forms.
Sign In or Register to comment.