Search code examples
delphiwidgetdelphi-2007docktopmost

Delphi 2007 - ManualFloat causes widget controls to float above all other windows


we have some Widget controls in a Delphi 2007 application. The widgets inherit from TWinControl. On the widget we call the TControl method ManualFloat to undock the widget.

The issue is that when MainFormOnTaskBar is true calling ManualFloat gives the widget StayOnTop like behavior causing it to float above all windows including other applications. This is an issue because if you open a modal dialog from a form then it appears behind the widget. When MainFormOnTaskBar is False then modal dialogs appear on top of the widgets.

Does anyone know how I can resolve this issue by not allowing the widgets to become topmost or at least shed some light on a possible solution/workaround? My guess is that the widget is getting parented to Application.MainForm.Handle and that is why I'm getting this behavior.

Thanks in advance.


Solution

  • Did you try to force parent of your Widget as main form ?

    MyWidget.manualFloat(screenpos);    
    MyWidget.Parent := MyMainForm;
    MyWidget.ParentWindow := MyMainForm.Handle;
    MyWidget.left := left desired 
    MyWidget.Top := Right.desired;