Locked out from changing BoundsRect during the TFORM.OnCreate event if not using POSITION := poDesign
Original Reporter info from Mantis: jamie @jamie
-
Reporter name: jamie philbrook
Original Reporter info from Mantis: jamie @jamie
- Reporter name: jamie philbrook
Description:
Trying to change the boundsRect from a Setup file or directly while in the OnCreate event is fruitless .
Only when using Position := poDesign can you do this.
In my old Delphi (3), this works fine except for the poScreenCenter, that does lock it out but I don't know why they
would even do that.
In Delphi using the poDefault allows you to make changes to the BoundsRect within the OnCreate event. This is needed in
cases such as not having a defined configuration of form placement on the screen. The user for the first initial time around
needs to allow windows(OS) to place the form at a suitable place and when the app exits it can use this value for the setup or
what ever value the BoundsRect happens to be after user is done with app so that the next time it starts up there will be some
configuration to use.
Although this works if I use poDesign there is an issue with that, my placement of the forms may not be suited for the
user's screen.
So as it is now, I need to calculate the best choice of the first time around and that takes a little code to do this.
This locking feature basically makes the poDefault and a few others a useless function class if you can't override it within
the OnCreate event, which is the most practical place to do it.
Steps to reproduce:
Postiton : poDefault;
In Oncreate event..
BoundsRect := Rect(0,0,320,320);
that will not change the position of the form.
Mantis conversion info:
- Mantis ID: 35739
- Version: 2.0.2