Marty

Marty

  • NA
  • 8
  • 11.5k

Help in Creating same form style as on the IDE

Jan 27 2006 9:58 AM
Untitled Document

I would like to create a form that has the similar actions to what is on the MS 2003 IDE default Right side (Solution Explorer with Properties in the middle and Definitions panel on bottom.

This is what I done.

Creating a form and added a panel1 docked on the right side.

Added panel2 and docked to the top then add a splitter in panel1 and docked it on top. Added RichText in Panel2 and docked it to the top and added another RichText in Panel2 and docked it to the bottom of Panel2. Added RichText to Panel1 and docked it to the top and added another RichText to Panel1 and docked it to the bottom.

The splitter will move up all the way to the top of the form but not all the way down. Why is that?

If I make RichTextBox3 smaller then it will move further down but does not make the same effect as the IDE when the Solution Window is pulled down with the slider beyound the Properties window.

Any Ideas would be apprieatted.

Is there a way to assign the slidder to go a certain distance up or down?

Most likelyI'm doing something wrong in how the panel and text boxes are assigned.

Thanks Marty

Code follows.



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

namespace IDEtest
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.RichTextBox richTextBox2;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.RichTextBox richTextBox3;
private System.Windows.Forms.RichTextBox richTextBox4;
private System.Windows.Forms.Splitter splitter2;
private System.ComponentModel.IContainer components;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (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()
{
this.components = new System.ComponentModel.Container();
this.panel1 = new System.Windows.Forms.Panel();
this.richTextBox4 = new System.Windows.Forms.RichTextBox();
this.richTextBox3 = new System.Windows.Forms.RichTextBox();
this.splitter1 = new System.Windows.Forms.Splitter();
this.panel2 = new System.Windows.Forms.Panel();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.richTextBox2 = new System.Windows.Forms.RichTextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.splitter2 = new System.Windows.Forms.Splitter();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.richTextBox4);
this.panel1.Controls.Add(this.richTextBox3);
this.panel1.Controls.Add(this.splitter1);
this.panel1.Controls.Add(this.panel2);
this.panel1.Dock = System.Windows.Forms.DockStyle.Right;
this.panel1.Location = new System.Drawing.Point(272, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(264, 470);
this.panel1.TabIndex = 0;
//
// richTextBox4
//
this.richTextBox4.Dock = System.Windows.Forms.DockStyle.Left;
this.richTextBox4.Location = new System.Drawing.Point(0, 400);
this.richTextBox4.Name = "richTextBox4";
this.richTextBox4.Size = new System.Drawing.Size(264, 22);
this.richTextBox4.TabIndex = 3;
this.richTextBox4.Text = "richTextBox4";
//
// richTextBox3
//
this.richTextBox3.Dock = System.Windows.Forms.DockStyle.Bottom;
this.richTextBox3.Location = new System.Drawing.Point(0, 422);
this.richTextBox3.Name = "richTextBox3";
this.richTextBox3.Size = new System.Drawing.Size(264, 48);
this.richTextBox3.TabIndex = 2;
this.richTextBox3.Text = "richTextBox3";
//
// splitter1
//
this.splitter1.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.splitter1.Dock = System.Windows.Forms.DockStyle.Top;
this.splitter1.Location = new System.Drawing.Point(0, 392);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(264, 8);
this.splitter1.TabIndex = 1;
this.splitter1.TabStop = false;
//
// panel2
//
this.panel2.Controls.Add(this.richTextBox1);
this.panel2.Controls.Add(this.richTextBox2);
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(264, 392);
this.panel2.TabIndex = 0;
//
// richTextBox1
//
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.richTextBox1.Location = new System.Drawing.Point(0, 352);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(264, 40);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "richTextBox1";
//
// richTextBox2
//
this.richTextBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox2.Location = new System.Drawing.Point(0, 0);
this.richTextBox2.Name = "richTextBox2";
this.richTextBox2.Size = new System.Drawing.Size(264, 392);
this.richTextBox2.TabIndex = 1;
this.richTextBox2.Text = "richTextBox2";
//
// splitter2
//
this.splitter2.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.splitter2.Dock = System.Windows.Forms.DockStyle.Right;
this.splitter2.Location = new System.Drawing.Point(264, 0);
this.splitter2.Name = "splitter2";
this.splitter2.Size = new System.Drawing.Size(8, 470);
this.splitter2.TabIndex = 1;
this.splitter2.TabStop = false;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(536, 470);
this.Controls.Add(this.splitter2);
this.Controls.Add(this.panel1);
this.Name = "Form1";
this.Text = "Form1";
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}