Design Help - Panel and more

Hi guys :)
In Visual Studio 2005, I wanted to write a Windows Application which has the dialog soemthing like this:
_
| | |
| Option| List |
|||
| Detail |
|_|
lol, nice ASCII art :D
Anyway, I am not finding ANY panel property or splitter that can solve this simple task.
I want the inner control to be docked to fill, so it will rezise as the windows resizes.
Please help me indicate a Control that can do something like this.

Thanks in advance.

[504 byte] By [BlackMan890] at [2007-12-17]
# 1
Hey Jonathan - You'll need to use a pair of SplitContainers to accomplish this. For example,

1. Drag a SplitContainer 'A' onto your Form.
2. Set 'A's Orientation property to Horizontal.
3. Drag another SplitContainer 'B' into the top part of Splitcontainer 'A'.
4. Set SplitContainer 'B's Orientation property to vertical.

and you should be all set.

AaronBrethorstMSFT at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...
# 2
Sorry, but that didn't work for me :-/
The user is suposed to change the width and heigt of those property, kinda like Thunderbird.
I tried using TableLayoutPanel but I was unable to find any setting that sets the user to allow the heigt and the width.
So as in your example, i want the user to be able to set the heigt of the 'B' splitter and the width of the 'A' splitter.
BlackMan890 at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...
# 3

I'm moving the thread over to the Windows Forms discussion. They should be able to give you a more-complete answer.

Thanks,
Aaron

AaronBrethorstMSFT at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...
# 4
I don't quite understand how Aaron's answer didn't work. What do you mean by 'changing the width and height of those property'? I am not familair with Thunderbird...
The panels can individually be dragged using the slider, gaining all controls over sizes. Do you mean the width and height of the splitter bars? Or do you mean by 'user' the client who wants to alter the sizes of the panels programmatically?
jvanderbeek at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...
# 5
here is an example of how I want the panels to work:
212.30.216.237/picture/one.jpg
212.30.216.237/picture/two.jpg
212.30.216.237/picture/three.jpg
I want the user to be able to to exactly like this, to control the size of the panels like I did in this example.
When i tested what he says, I was unable to change the size of the splitters when running.

BlackMan890 at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...
# 6

The link is broken :(. Can you try one more time?

jvanderbeek at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...
# 8

Ok, well... I've made a piece of sample code which resembles your example (if I understood correctly).

Did you by any chance forgot to dock the controls correctly? Well, let me know if this sample answers your question:



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SplitContainerTest
{
public class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;

/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose( bool disposing )
{
if( disposing && ( components != null ) )
{
components.Dispose();
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode( "Node1" );
System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode( "Node2" );
System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode( "Node5" );
System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode( "Node6" );
System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode( "Node3", new System.Windows.Forms.TreeNode[] {
treeNode3,
treeNode4} );
System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode( "Node4" );
System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode( "Node0", new System.Windows.Forms.TreeNode[] {
treeNode1,
treeNode2,
treeNode5,
treeNode6} );
System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem( new string[] {
"abc",
"12",
"56676",
"998067"}, -1 );
System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem( "def" );
System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem( "xyz" );
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.treeView1 = new System.Windows.Forms.TreeView();
this.listView1 = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
this.listView2 = new System.Windows.Forms.ListView();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point( 0, 0 );
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add( this.splitContainer2 );
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add( this.listView2 );
this.splitContainer1.Size = new System.Drawing.Size( 431, 366 );
this.splitContainer1.SplitterDistance = 133;
this.splitContainer1.TabIndex = 0;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.Location = new System.Drawing.Point( 0, 0 );
this.splitContainer2.Name = "splitContainer2";
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add( this.treeView1 );
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add( this.listView1 );
this.splitContainer2.Size = new System.Drawing.Size( 431, 133 );
this.splitContainer2.SplitterDistance = 143;
this.splitContainer2.TabIndex = 0;
//
// treeView1
//
this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView1.Location = new System.Drawing.Point( 0, 0 );
this.treeView1.Name = "treeView1";
treeNode1.Name = "Node1";
treeNode1.Text = "Node1";
treeNode2.Name = "Node2";
treeNode2.Text = "Node2";
treeNode3.Name = "Node5";
treeNode3.Text = "Node5";
treeNode4.Name = "Node6";
treeNode4.Text = "Node6";
treeNode5.Name = "Node3";
treeNode5.Text = "Node3";
treeNode6.Name = "Node4";
treeNode6.Text = "Node4";
treeNode7.Name = "Node0";
treeNode7.Text = "Node0";
this.treeView1.Nodes.AddRange( new System.Windows.Forms.TreeNode[] {
treeNode7} );
this.treeView1.Size = new System.Drawing.Size( 143, 133 );
this.treeView1.TabIndex = 0;
//
// listView1
//
this.listView1.Columns.AddRange( new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2,
this.columnHeader3} );
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView1.Items.AddRange( new System.Windows.Forms.ListViewItem[] {
listViewItem1,
listViewItem2,
listViewItem3} );
this.listView1.Location = new System.Drawing.Point( 0, 0 );
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size( 284, 133 );
this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// listView2
//
this.listView2.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView2.Location = new System.Drawing.Point( 0, 0 );
this.listView2.Name = "listView2";
this.listView2.Size = new System.Drawing.Size( 431, 229 );
this.listView2.TabIndex = 0;
this.listView2.UseCompatibleStateImageBehavior = false;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F );
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size( 431, 366 );
this.Controls.Add( this.splitContainer1 );
this.Name = "Form1";
this.Text = "Form1";
this.splitContainer1.Panel1.ResumeLayout( false );
this.splitContainer1.Panel2.ResumeLayout( false );
this.splitContainer1.ResumeLayout( false );
this.splitContainer2.Panel1.ResumeLayout( false );
this.splitContainer2.Panel2.ResumeLayout( false );
this.splitContainer2.ResumeLayout( false );
this.ResumeLayout( false );

}

#endregion

private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.TreeView treeView1;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;
private System.Windows.Forms.ListView listView2;
}
}

Regards,
Jelle van der Beek

jvanderbeek at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...
# 9
Thank you VERY much, that is excactly what I was looking for :)
Thank you once and again :D
BlackMan890 at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...