SplitterDistance problem


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)



  • You must to post comments

Can’t reproduce. See attached small sample.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.