Author: Tomas Rutkauskas
I have written an inventory app in Delphi 4 using MDI forms. Everything seems to
work great. The only thing is, that when I open one child form, then close that
same child form and reopen it, the form descends a quarter of an inch. As I open
other child forms, they keep descending the same quarter inch (or so). After about
four open windows, the 5th opens back at the top of the parent form. Is there any
way to have child windows open at the top of my parent window (especially when all
other child forms have been closed).
Answer:
Try overriding CreateParams():
1 2 procedure CreateParams(var Params: TCreateParams); override;
3 4 procedure TNotebook.CreateParams(var Params: TCreateParams);
5 begin6 inherited CreateParams(Params); {call the inherited first}7 with Params do8 begin9 X := YourXPos;
10 Y := YourYPos;
11 end;
12 end;