On Saturday 08 October 2016 18:32:02 mohamed hamza wrote: > Hi Martin, > > I Tried mseuniverse demo subform. > I added OnEnter event to tab0fo.editb > > procedure ttab0fo.Onenter(const sender: TObject); > begin > with editb do enabled:=not(enabled); > end; > > When I select tab1 and back to tab0 the editb control is reseted to its > initial value? > Edit widgets automatically store the value property in tstatfile if optionsedit1 oe1_savevalue is set, some widgets store additional properties which can be set by user if oe1_savestate is set (for example column widths of dropdown widgets), tfilenameedit stores options set by the user if oe1_saveoptions is set. The "enabled" widget-property can not been set by users so it will not be stored automatically. Please use tstatfile.onstatread/onstatwrite or onstatupdate in order to save/restore enabled state of the widgets.
" procedure tmainfo.statreadev(const sender: TObject; const reader: tstatreader); begin edit1.enabled:= reader.readboolean('edit1_enabled',edit1.enabled); //default value end; procedure tmainfo.statwriteev(const sender: TObject; const writer: tstatwriter); begin writer.writeboolean('edit1_enabled',edit1.enabled); end; " The reason why not to store properties which can not been set by users is that statfiles easily can be manipulated. Martin ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk