string FractionCookie { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The FractionCookie property of the SplitContainer class allows you to save and restore the position of the splitter using a browser cookie. By setting this property, the splitter's position is automatically saved to a cookie and restored when the page is reloaded. This feature is useful for maintaining user preferences across sessions.

Usage

To use the FractionCookie property, simply assign a string value to it. This string will be used as the key for the cookie that stores the splitter's position. Ensure that the key is unique to avoid conflicts with other cookies.

Example

// Example of setting the FractionCookie property
var splitContainer = new SplitContainer();
splitContainer.FractionCookie = "mySplitterPosition"; // This will save the splitter position under the key "mySplitterPosition"