473,738 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_Split terMoved(ByVal sender As Object, ByVal e As
System.Windows. Forms.SplitterE ventArgs) Handles Splitter1.Split terMoved
'// Saving new Splitter X-Location
oSettings.SaveS etting(Applicat ion.ProductName , Me.Name,
"SplitterLocati onX", Splitter1.Locat ion.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(ByVa l sender As Object, ByVal e As System.EventArg s)
Handles MyBase.Load
Try
'// Retrieving last Splitter X-Location
Dim intX As Integer =
Convert.ToInt32 (oSettings.GetS etting(Applicat ion.ProductName , Me.Name,
"SplitterLocati onX", 160))
Splitter1.Locat ion = New Point(intX, Splitter1.Locat ion.Y)

Catch ex As Exception
MessageBox.Show (ex.Message, "Error (Form1.Load)",
MessageBoxButto ns.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 3698
"Mika M" <mika.mahonen@n ospam_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@n ospam_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_Split terMoved(ByVal sender As Object, ByVal e As
System.Windows. Forms.SplitterE ventArgs) Handles Splitter1.Split terMoved
'// Saving new Splitter X-Location
oSettings.SaveS etting(Applicat ion.ProductName , Me.Name,
"SplitterLocati onX", Splitter1.Locat ion.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
3313
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 correctly is: lhsTreeview - Dock = Fill, Anchor = Top,Left splitter - Dock = Right rhsPanel - Dock = Right, Anchor = Top,Left
3
2867
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 a four-way-splitter control? Regards, Andre Loker
3
6025
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
8103
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 Left, Panel on right of form w/ Dock set to Fill, Splitter between them set w/ Dock set to Left. Works as advertised. But... if I change to have two panels on the form one on the left with Dock set to Left, a panel on the right with Dock set to...
1
3464
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 individual control and still use a splitter?
2
5555
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 work! Where should I put splitter? Hrcko
4
1682
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, and the ones for SplitterMoving are not. I have a panel with 2 controls in it and a splitter. I also have a textbox to log all the values of the events.
4
5988
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 the top of the splitter? I have various instances of similar scenarios and cut-and-try sometime I can get it to work and sometimes I can not. What is the correct way?
1
1721
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 there is some empty space on the form where I have a few button controls. When the app starts the form is 800x600, but I need to give the user the ability to maximize and to resize the form to whatever size they like. When the occurs I need the...
0
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8787
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9259
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.