[Gambas-user] How Settings.Read works?
gian
bagoneo at libero.it
Thu Sep 29 13:43:58 CEST 2022
Il 29/09/22 13:19, Benoit Minisini ha scritto:
> Le 29/09/2022 à 12:29, gian via User a écrit :
>> Hi,
>>
>> the issue is simple: either I have not understood how Settings.Read
>> works, or Settings.Read does not work completely.
>>
>> [code]
>>
>> Public Sub Form_Open()
>>
>> ' If Settings.Exist("FMain/Geometry") Then '
>> <------------------this works
>> ' 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
>>
>> End
>>
>> Public Sub Form_Close()
>>
>> Settings.Write(Me)
>>
>> End
>>
>> [/code]
>>
>> Regards & Thanks
>>
>> Gianluigi
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
> Settings class has special support for windows (and controls having a
> Settings property).
>
> 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.
>
> Regards,
>
Hi Benoit and Bruce,
thank you very much for your answers
Regards
Gianluigi
More information about the User
mailing list