[Gambas-user] How Settings.Read works?
benoit.minisini at gambas-basic.org
Thu Sep 29 13:19:25 CEST 2022
Le 29/09/2022 à 12:29, gian via User a écrit :
> the issue is simple: either I have not understood how Settings.Read
> works, or Settings.Read does not work completely.
> Public Sub Form_Open()
> ' If Settings.Exist("FMain/Geometry") Then ' <------------------this
> ' Settings.Read(Me)
> ' Else
> ' Me.X = 100
> ' Me.Y = 100
> ' Endif
> Settings.Read(Me, "Geometry", [100, 100, 512, 512, 0, 0]) ' <---this
> *not* works, also with key "FMain/Geometry" or nothing key
> Public Sub Form_Close()
> Regards & Thanks
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
Settings class has special support for windows (and controls having a
So, for windows, you just have to write 'Settings.Write(Me)' to save its
geometry, and 'Settings.Read(Me)' to restore it.
You can't use the default value argument in that case, as you can't
guess the format used for storing the window data.
More information about the User