Property Store

Viewing 2 reply threads
  • Author
    Posts
    • #3050
      Barry Wood
      Participant

        Hi,

        I haven’t used this component before, so maybe I have something wrong?

        I have a TRzRadioGroup (called rgAutoStart) with 2 items ‘Yes’ and ‘No’, which at design time is set to ItemIndex 1 (‘No’).  I also have a TRzPropertyStore linked to a TRzRegIniFile (Section Name is ‘AutoStart’).

        In the PropertyStore I’ve created one item Component = ‘rgAutoStart’ with Property Name =   ‘ItemIndex’.

        So I’m thinking if the user changes the itemindex from 1 (‘No’) to 0 (‘Yes’), then this setting will be saved in the Ini file under Section AutoStart and then read again at startup and set the radio group accordingly. This isn’t happening as the INI file isn’t being written to.

        The ini file is working OK as I also have a form close component saving the window position.

        Do I have something not set or missing on the using the Property Store component?

         

      • #3051
        Ray Konopka
        Keymaster

          Hi Barry,

          In order to save the specified property values to the property store (i.e. registry) you need to call the Save method (RzPropertyStore1.Save). For example, when your app closes.

          Likewise, at startup (e.g. FormCreate) you need to call the Load method to instruct the TRzPropertyStore component to load the stored property values and apply them to the components.

          Ray

        • #3053
          Barry Wood
          Participant

            Works a treat, many thanks … I shudda read the help file!

        Viewing 2 reply threads
        • You must be logged in to reply to this topic.