473,385 Members | 1,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Splitter control location

Hello!

My windows form has Splitter control on it, and I save splitter's last
X-location when user changes it like ...

Private Sub Splitter1_SplitterMoved(ByVal sender As Object, ByVal e As
System.Windows.Forms.SplitterEventArgs) Handles Splitter1.SplitterMoved
'// Saving new Splitter X-Location
oSettings.SaveSetting(Application.ProductName, Me.Name,
"SplitterLocationX", Splitter1.Location.X.ToString())
End Sub

.... and this is working fine so far.
But when user opens this form I want my application to set splitter
X-location to this saved position again, and I tried like this way ...

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Load
Try
'// Retrieving last Splitter X-Location
Dim intX As Integer =
Convert.ToInt32(oSettings.GetSetting(Application.P roductName, Me.Name,
"SplitterLocationX", 160))
Splitter1.Location = New Point(intX, Splitter1.Location.Y)

Catch ex As Exception
MessageBox.Show(ex.Message, "Error (Form1.Load)",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub

.... but it's not moving to this retrieved X-location value :( What wrong
with this?

Anyway 'intX'-integer variable contains correct saved value (160 is only
default value if 'intX'-integer variable is not saved yet).

--
Thanks in advance!

Mika
Nov 20 '05 #1
2 3669
"Mika M" <mika.mahonen@nospam_kolumbus.fi> schrieb
Hello!

My windows form has Splitter control on it, and I save splitter's
last X-location when user changes it like ...


Save and restore the width of the control left to the splitter. The splitter
is docked, so it's position is determined by the size of the control(s) left
to it.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
* "Mika M" <mika.mahonen@nospam_kolumbus.fi> scripsit:
My windows form has Splitter control on it, and I save splitter's last
X-location when user changes it like ...

Private Sub Splitter1_SplitterMoved(ByVal sender As Object, ByVal e As
System.Windows.Forms.SplitterEventArgs) Handles Splitter1.SplitterMoved
'// Saving new Splitter X-Location
oSettings.SaveSetting(Application.ProductName, Me.Name,
"SplitterLocationX", Splitter1.Location.X.ToString())
End Sub

... and this is working fine so far.
But when user opens this form I want my application to set splitter
X-location to this saved position again, and I tried like this way ...


Have a look at the splitter's 'SplitPosition' property!

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: John | last post by:
Hi, I have a group of controls in a panel on the right-hand side of a splitter and a treeview on the left-hand side. The only configuration that I can find to make the right-hand side resize...
3
by: Andre Loker | last post by:
Hi! For my current application I'm looking for a four-way-(cross) splitter control (as often seen in 3D-editors). The .NET Splitter-class is (IIRC) only a two-way splitter. Does anyone know such...
3
by: MFRASER | last post by:
How do I move the splitter inside of code. if(TypeA) { this.pnlHXMLList.Visible = false; this.splTop.is.Top = 65; } else
4
by: BBM | last post by:
I'm trying to set up a form with two panels divided by a Splitter control. I can make the Splitter work in the situations described in the documentation (Listbox or TreeView on left w/Dock set to...
1
by: Chuck Bowling | last post by:
I have a couple of controls that I'd like to use a vertical splitter control with. My problem is that I want different heights for the controls. Is there any way to set the height of each...
2
by: Hrcko | last post by:
How to use this control? I have to grids on my form, one on the top and one on bottom. When I start application I want to be able to move bottom grip up, and top grid down, but it doesn't...
4
by: Marina | last post by:
Hi, It seems that I am seeing an inconsistency in the arguments that get passed to the SplitterMoved vs. SplitterMoving events. As in, the ones for the SplitterMoving are correct coordinates,...
4
by: Frank | last post by:
On a form I have a control that is docked top. Under it a splitterbar that is also docked top. If I want to programmatically move the splitter how do I do that: Set the height of the control or...
1
by: JDeats | last post by:
I have a WinForm with three Splitter controls on it. The form divides up in this order: Tab Control (docked to the left): Splitter1: RichTextBox (docked to the left): Splitter2 After Splliter2...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.