473,386 Members | 1,997 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,386 software developers and data experts.

splitter problems

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

The problem is that resizing the form repositions the splitter, making
the the left-hand side treeview grow, I would rather that the splitter
not reposition, resulting in the right-hand side growing.

What settings should be changed to make this happen.

Thanks

Nov 15 '05 #1
7 3280
hi john
the splitter and it's functions really depends on the order where
the control are placed on the form.
i would do the following
1. place the treeview - Dock = left
2. place the splitter - Dock = left
3. place rhsPanel - Dock = fill

"John" <john@no_spam> wrote in message
news:ua**************@tk2msftngp13.phx.gbl...
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

The problem is that resizing the form repositions the splitter, making
the the left-hand side treeview grow, I would rather that the splitter
not reposition, resulting in the right-hand side growing.

What settings should be changed to make this happen.

Thanks

Nov 15 '05 #2
John <john@no_spam> wrote in news:ua**************@tk2msftngp13.phx.gbl:
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

The problem is that resizing the form repositions the splitter, making
the the left-hand side treeview grow, I would rather that the splitter
not reposition, resulting in the right-hand side growing.

What settings should be changed to make this happen.


the control that is set to 'fill' will resize when you have a
splitter in place and you resize the window. If you want to have another
control to resize, you have to set that other control to Fill instead of
the treeview, in your case the rhsPanel.

As Stefan said, it depends on the order in the form where the
splitter docks against. You can change that by bringing a control to the
front / sending it to the back in the gui designer.

FB

--
Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com
Nov 15 '05 #3
Stefan wrote:
hi john
the splitter and it's functions really depends on the order where
the control are placed on the form.
i would do the following
1. place the treeview - Dock = left
2. place the splitter - Dock = left
3. place rhsPanel - Dock = fill


Thanks, but that configuration will not reposition the controls on the
rhs, ie. moving the splitter right will move the treeview over the rhs
controls.

Nov 15 '05 #4
Hi,

John wrote:
Thanks, but that configuration will not reposition the controls on the
rhs, ie. moving the splitter right will move the treeview over the rhs
controls.


Have you set the Anchor styles for the controls on the right panel? The
panel itself is DockStyle.Fill so it will resize okay.

-- Pete
Nov 15 '05 #5
Frans Bouma wrote:
As Stefan said, it depends on the order in the form where the
splitter docks against. You can change that by bringing a control to the
front / sending it to the back in the gui designer.


This is correct, the problem is that the order is determined by the
order that you place the controls on the form in the Design view. The
left-hand side control *must* be placed on the form before right-hand
side control. If you placed the right-hand control on first, you must
remove all your controls and start from scratch. I could not find anyway
to get it to work, after placing the right-hand side control first,
either by send to back / front or manually moving the control creation
code in InitializeComponent().

MS Moderators, please take note of this and create a KB article, and,
please, fix it for the next release.

Thanks

Nov 15 '05 #6
John wrote:

MS Moderators, please take note of this and create a KB article, and,
please, fix it for the next release.


The following code in the splitter1.LocationChanged event will show that
the right-hand side panel does not change size if it is placed on the
control after the left-hand side panel in Desgin view with following
configuration:

panel2 Dock=left
panel1 Dock=fill
splitter1 Dock=left

private void splitter1_LocationChanged(object sender, EventArgs e)
{
Trace.WriteLine("Panel1 size: " + panel1.Size.ToString());
Trace.WriteLine("Panel2 size: " + panel2.Size.ToString());
}

Nov 15 '05 #7
John wrote:

The following code in the splitter1.LocationChanged event will show that
the right-hand side panel does not change size if it is placed on the
control after the left-hand side panel in Desgin view


Doh!
"after" should be "before"

Anyways, from the previous posts you get my drift :)

Nov 15 '05 #8

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

Similar topics

0
by: keith | last post by:
I have a form and added a RichTextBox and set Dock to TOP, added a Splitter and set Dock to TOP, and finally added a listView set Dock Fill. Then added several items to the listView control. ...
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...
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...
5
by: Duncan | last post by:
Hi I am using a splitter within a form with buttons on the left hand side. I would like it so that when i click one of these buttons it changes the UI on the right. I would like to design all...
0
by: Atara | last post by:
I have a mainPanel filled with leftPanel, splitter, rightPanel. all is working fine. I want to add some pictureBox at the edges of the mainPanel (sort of creating a graphic border) 1. If I...
5
by: Sam | last post by:
Hi, I have a panel docked to the bottom of my form. This panel can be expanded vertically by clicking on a button. When the user click on the button again, the panel is then collapsed. The panel...
2
by: Istvan | last post by:
Hello ....Window.Forms.... Can somebody help me with Panels and Splitters ? I want to add three Panels to one Usercontrol , between them with two movable Splitter. First Row: 2...
1
by: JDeats | last post by:
I have a simple WinForm with a WinForms splitter down the middle. I would like to make it so when the user clicks on a button inside the left portion of the screen (the panel to the splitters left)...
3
by: Jeffrey Walton | last post by:
Hi All, I have a horizontal Splitter, for which I would like the top panel to remain 20 pixels in height. I do this because I have a containter on it, and I overide the OnPaint method. It is...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...
0
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,...
0
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...

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.