Kiran's Blog

Ramblings from a dehydrated mind…

  • Archives

    • 14,897

Splitter Window in C#..

Posted by kiraninbng on August 13, 2006


Heres what it takes to create a splitter window with a listbox and treeview in C#,

 // Create the controls
 this.m_ListBox = new System.Windows.Forms.ListBox();
 this.m_Splitter = new System.Windows.Forms.Splitter();
 this.m_TreeView = new System.Windows.Forms.TreeView();
   
 // Set the docking properties of the control
 this.m_ListBox.Dock = System.Windows.Forms.DockStyle.Left;
 this.m_Splitter.Dock = System.Windows.Forms.DockStyle.Left;
 this.m_TreeView.Dock = System.Windows.Forms.DockStyle.Fill;

 // Set the properties of the control
 this.m_ListBox.Size = new System.Drawing.Size(120, 264);

 this.m_Splitter.Location = new System.Drawing.Point(120, 0);
 this.m_Splitter.Size = new System.Drawing.Size(3, 266);

 this.m_TreeView.Location = new System.Drawing.Point(123, 0);
 this.m_TreeView.Size = new System.Drawing.Size(169, 266);

It is even more simpler if you use the Form designer to get a splitter control working.Just add the controls and set the docking properties in the property window,no need to write a single line of code.

Advertisements

One Response to “Splitter Window in C#..”

  1. prosabem said

    “| Theme: Andreas09 by Andreas Viklund.”
    How much is real?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: