0

i have created a splitterLocation setting, Type system.Drawing.Point and Scope : User. to save the splitter location when the user change it. and load again with the new location when the form load.

private void splitter1_LocationChanged(object sender, EventArgs e)
    {
      MailSystem.Properties.Settings.Default.splitterLocation = splitter1.Location;
        MailSystem.Properties.Settings.Default.Save();
    }

private void Form1_Load(object sender, EventArgs e)
    {
        splitter1.Location = MailSystem.Properties.Settings.Default.splitterLocation;
     }

but it doesnt work i dont know why ?.

1 Answer 1

1

Try moving the saving code to the FormClosing event.

private void Form1_FormClosing(object sender, EventArgs e)
{
  MailSystem.Properties.Settings.Default.splitterLocation = splitter1.Location;
  MailSystem.Properties.Settings.Default.Save();
}

and make sure your splitter1 control isn't being docked, DockStyle.None.

1
  • yea the problem is that it's docked. Thank you Aug 26, 2011 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.