G
Guest
I'm having a problem when using multiple splitcontainers on a form and saving
user settings for the SplitterDistance. Here's a description:
I place one splitcontainer in my bare form, add a project setting called,
e.g., splitDist1 which is an int user setting, and attach it to the
SplitterDistance under Application Settings in VS2005. On the form_closing
event I add Properties.Settings.Default.Save(). When I start the application
and move the splitter around, the value is stored and if I then shutdown and
restart the form, the splitter will start in the location when I last exited.
Perfect.
However, if I now add another splitcontainer in panel1 of the first
splitcontainer and follow the same procedure above to add a user setting
called splitDist2, the value for splitDist1 no longer seems to be saved
properly. If I resize the panels on both splitcontainers, splitContainer2's
value will be saved but the SplitterDistance property for splitContainer1 is
always started back at its initial location.
I've tried adding a third splitcontainer into a panel of the second just for
testing and things get even weirder. It appears that something's getting
confused and those settings aren't being stored properly. I don't know
whether I'm not doing something correctly (which is entirely possible) or
whether this is some sort of glitch in something else.
Any help would be appreciated!
user settings for the SplitterDistance. Here's a description:
I place one splitcontainer in my bare form, add a project setting called,
e.g., splitDist1 which is an int user setting, and attach it to the
SplitterDistance under Application Settings in VS2005. On the form_closing
event I add Properties.Settings.Default.Save(). When I start the application
and move the splitter around, the value is stored and if I then shutdown and
restart the form, the splitter will start in the location when I last exited.
Perfect.
However, if I now add another splitcontainer in panel1 of the first
splitcontainer and follow the same procedure above to add a user setting
called splitDist2, the value for splitDist1 no longer seems to be saved
properly. If I resize the panels on both splitcontainers, splitContainer2's
value will be saved but the SplitterDistance property for splitContainer1 is
always started back at its initial location.
I've tried adding a third splitcontainer into a panel of the second just for
testing and things get even weirder. It appears that something's getting
confused and those settings aren't being stored properly. I don't know
whether I'm not doing something correctly (which is entirely possible) or
whether this is some sort of glitch in something else.
Any help would be appreciated!