Skip to content

SplitterDistance problem #1249

Closed
Closed

Description

@itg-assistant

Matthew Ferry asked 2017-12-08 03:16:02 UTC

I'm having trouble with .SplitterDistance using the splitter container.  I'm trying to save and restore the splitter distance for the user by using a cookie value, so that I set it to the same place the user left it.

Reading and writing the cookie is working fine.  I write the cookie in the splittermoved event, and I read the cookie and set the splitter distance in the user control load event.

Setting the splitter distance in a user control load event does not seem to do anything.  Its always some other value in terms of where the splitter is actually placed.

Is there an open bug for this?  Pls advise...

Here is some code (pls ignore my cookie wrapper methods - they work just fine):

From user control load event:

Dim splitHorizontal As Integer = ReadLocalCookieInteger("Split.H")
AlertBox.Show("H Splitter cookie = " & splitHorizontal.ToString)
If splitHorizontal > 0 Then splitContainerMain.SplitterDistance = splitHorizontal

AlertBox.Show("H Splitter distance on load = " & splitContainerMain.SplitterDistance.ToString)

And the splitter moved event:

WriteLocalCookie("Split.H", splitContainerMain.SplitterDistance.ToString)
AlertBox.Show("H Splitter distance = " & splitContainerMain.SplitterDistance.ToString)

Activity

  1. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2017-12-08 21:47:46 UTC

    Can't reproduce. See attached small sample.

  2. added
    BugSomething is broken or behaving unexpectedly.
    on Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is broken or behaving unexpectedly.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions