2602:Making a form selectable without the main form.

2602:Making a form selectable without the main form.

KEYWORDS: form, top, select, desktop AREA: VCL Programming

Q:  How do I make it so that only the form I select comes to
the top?  (i.e. without the main form)

A:   Try this in any secondary window that you DON'T want
dragging the program along:

  ...
  private {This goes in the for's type declaration.}
    { Private declarations }
    procedure CreateParams(VAR Params: TCreateParams); override;
  ...

procedure TForm2.CreateParams(VAR Params: TCreateParams);
begin
  Inherited CreateParams(Params);
  Params.WndParent := GetDesktopWindow;
end;

       By setting the form's parent window handle to the
desktop, you remove the link that would normally force the
whole application to come to the top when this form comes to
the top.


        TI

DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.


Return to Complete TI List