Forum > LCL

TForm.SessionProperties Left,Top don't work with poDefault, poDefaultPosOnly,...

(1/2) > >>

RolfW:
Left and Top are stored in the sessionproperties file, but are not applied to the form at runtime. Requires TForm.Position=poDesigned, poDefaultSizeOnly,poMainFormCenter or poOwnerFormCenter. The TForm.Width property is always applied to the form from the session storage.
This is not documented in the help file and I'm assuming this is a bug since the session property Width works with all position settings.
I've tried in vain to find where the sessionproperty values are applied to the form. Perhaps someone can help me.
TForm.SessionProperties is the published FSessionProperties string of TControl. There are no relevant occurences of FSessionPproperties or GetPropertyList in the LCL source code (*.pas, *.pp, *.p, *.inc files) show where it is applied to the form.

Thanks,
Rolf

Bart:
If Position is poDefault of poDefaultPosOnly the OS determines where the form will be shown.
If you want to decide where the form is shown (Top/Left), use poDesigned.

Bart

RolfW:
Sorry, Bart.
This isn't user friendly.
1. It's not documented.
2. Width in SessionProperties works even with Position=poDefaultSizeOnly
3. If I add Top and Left to SessionProperties I expect that this will override the Positon setting.

Do you know where it is done in the code?

Thanks,
Rolf

Bart:
AFAIK the behaviour of TForm.Position is well documented.
Position can override Top/Left, this is how it has always been.
The sessionproperties just stores all the forms porperties, it has nothing to do with how the Position property behaves.

Bart

Handoko:
I didn't use SessionProperties. Maybe it is not what you want, but you can try:
https://forum.lazarus.freepascal.org/index.php/topic,66776.msg512749.html#msg512749

Navigation

[0] Message Index

[#] Next page

Go to full version