473,659 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3301
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******** ******@tk2msftn gp13.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******** ******@tk2msftn gp13.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 InitializeCompo nent().

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.Locat ionChanged 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_Locat ionChanged(obje ct sender, EventArgs e)
{
Trace.WriteLine ("Panel1 size: " + panel1.Size.ToS tring());
Trace.WriteLine ("Panel2 size: " + panel2.Size.ToS tring());
}

Nov 15 '05 #7
John wrote:

The following code in the splitter1.Locat ionChanged 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
1030
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. When ran it, I cannot see the items in listView until dragged the Splitter control to very top. If I used a RichTextBox to replace the listView and typed some text in the box, I could see the text when ran it.
3
2861
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
4
8095
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...
5
1308
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 of my different screens at design time and not run time if possible. Very much like outlook where when you click on calendar the calendar shows on the right, same with contact etc!
0
1143
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 now calls splitter.bringToFront (because I donot want the pictures to hide it), canitcause to problems in the mainForm 'docking order' ?
5
2320
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 has a horizontal splitter, which the user can use to resize the panel when it is expanded. I would like to save the height of the panel when the user uses the splitter, so that when the panel is expanded via the button, it size will be...
2
3126
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 Columns ( 2 panels, with 1 splitter between them)
1
6064
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) that portion of the form is reduced in size by about 90% (I want to shrink this area of the of the form). The splitter doesn't appear to have any methods for programmatic resizing, I tried changing it's width settings and the splitter moved...
3
4165
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 being painted as a band similar to that of Disk Defragmentor. Any ideas on how to disable a Splitter panel from being resized? I've locked the controls (it stops me from resizing it at design time); I've set SplitterFixedPanel = Panel1 ; and I've...
0
8427
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
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
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...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2750
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
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.