Click here to Skip to main content
15,896,336 members
Articles / Desktop Programming / Windows Forms

Drag-and-Drop ListBox

Rate me:
Please Sign up or sign in to vote.
4.93/5 (33 votes)
18 May 2009CPOL14 min read 192.6K   7.3K   72  
DragDropListBox, a control derived from ListBox allowing drag-and-drop in multiselect mode.
namespace Oli.Controls.Tests
{
    partial class frmDragDropListBox
    {
        /// <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()
        {
			this.splitContainer1 = new System.Windows.Forms.SplitContainer();
			this.splitContainer2 = new System.Windows.Forms.SplitContainer();
			this.splitContainer3 = new System.Windows.Forms.SplitContainer();
			this.testDragDropListBoxCats1 = new Oli.Controls.Tests.TestDragDropListBox();
			this.testDragDropListBoxCats2 = new Oli.Controls.Tests.TestDragDropListBox();
			this.testDragDropListBoxDogs1 = new Oli.Controls.Tests.TestDragDropListBox();
			this.testDragDropListBoxDogs2 = new Oli.Controls.Tests.TestDragDropListBox();
			this.splitContainer1.Panel1.SuspendLayout();
			this.splitContainer1.Panel2.SuspendLayout();
			this.splitContainer1.SuspendLayout();
			this.splitContainer2.Panel1.SuspendLayout();
			this.splitContainer2.Panel2.SuspendLayout();
			this.splitContainer2.SuspendLayout();
			this.splitContainer3.Panel1.SuspendLayout();
			this.splitContainer3.Panel2.SuspendLayout();
			this.splitContainer3.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.splitContainer3);
			this.splitContainer1.Size = new System.Drawing.Size(686, 538);
			this.splitContainer1.SplitterDistance = 267;
			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.testDragDropListBoxCats1);
			// 
			// splitContainer2.Panel2
			// 
			this.splitContainer2.Panel2.Controls.Add(this.testDragDropListBoxCats2);
			this.splitContainer2.Size = new System.Drawing.Size(686, 267);
			this.splitContainer2.SplitterDistance = 341;
			this.splitContainer2.TabIndex = 0;
			// 
			// splitContainer3
			// 
			this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
			this.splitContainer3.Location = new System.Drawing.Point(0, 0);
			this.splitContainer3.Name = "splitContainer3";
			// 
			// splitContainer3.Panel1
			// 
			this.splitContainer3.Panel1.Controls.Add(this.testDragDropListBoxDogs1);
			// 
			// splitContainer3.Panel2
			// 
			this.splitContainer3.Panel2.Controls.Add(this.testDragDropListBoxDogs2);
			this.splitContainer3.Size = new System.Drawing.Size(686, 267);
			this.splitContainer3.SplitterDistance = 341;
			this.splitContainer3.TabIndex = 0;
			// 
			// testDragDropListBoxCats1
			// 
			this.testDragDropListBoxCats1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
						| System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.testDragDropListBoxCats1.DragDropGroup = "cats";
			this.testDragDropListBoxCats1.Location = new System.Drawing.Point(12, 12);
			this.testDragDropListBoxCats1.Name = "testDragDropListBoxCats1";
			this.testDragDropListBoxCats1.Size = new System.Drawing.Size(324, 241);
			this.testDragDropListBoxCats1.TabIndex = 0;
			// 
			// testDragDropListBoxCats2
			// 
			this.testDragDropListBoxCats2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
						| System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.testDragDropListBoxCats2.DragDropGroup = "cats";
			this.testDragDropListBoxCats2.Location = new System.Drawing.Point(5, 12);
			this.testDragDropListBoxCats2.Name = "testDragDropListBoxCats2";
			this.testDragDropListBoxCats2.Size = new System.Drawing.Size(324, 241);
			this.testDragDropListBoxCats2.TabIndex = 0;
			// 
			// testDragDropListBoxDogs1
			// 
			this.testDragDropListBoxDogs1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
						| System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.testDragDropListBoxDogs1.DragDropGroup = "dogs";
			this.testDragDropListBoxDogs1.Location = new System.Drawing.Point(12, 14);
			this.testDragDropListBoxDogs1.Name = "testDragDropListBoxDogs1";
			this.testDragDropListBoxDogs1.Size = new System.Drawing.Size(324, 241);
			this.testDragDropListBoxDogs1.TabIndex = 0;
			// 
			// testDragDropListBoxDogs2
			// 
			this.testDragDropListBoxDogs2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
						| System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.testDragDropListBoxDogs2.DragDropGroup = "dogs";
			this.testDragDropListBoxDogs2.Location = new System.Drawing.Point(5, 14);
			this.testDragDropListBoxDogs2.Name = "testDragDropListBoxDogs2";
			this.testDragDropListBoxDogs2.Size = new System.Drawing.Size(324, 241);
			this.testDragDropListBoxDogs2.TabIndex = 0;
			// 
			// frmDragDropListBox
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(686, 538);
			this.Controls.Add(this.splitContainer1);
			this.Name = "frmDragDropListBox";
			this.Text = "Test DragDropListBox";
			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.splitContainer3.Panel1.ResumeLayout(false);
			this.splitContainer3.Panel2.ResumeLayout(false);
			this.splitContainer3.ResumeLayout(false);
			this.ResumeLayout(false);

        }

        #endregion

		private System.Windows.Forms.SplitContainer splitContainer1;
		private System.Windows.Forms.SplitContainer splitContainer2;
		private TestDragDropListBox testDragDropListBoxCats1;
		private System.Windows.Forms.SplitContainer splitContainer3;
		private TestDragDropListBox testDragDropListBoxCats2;
		private TestDragDropListBox testDragDropListBoxDogs1;
		private TestDragDropListBox testDragDropListBoxDogs2;


	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer CySoft
Switzerland Switzerland
Apprenticeship as machine draughtsman.
School of engineering in electrical engineering.
Started programming as hobbyist. After some years as a programmer in the industry, I have made myself independent.

I speak: French, German, (some) English.

Languages: C#, VB.NET, Basic, Pascal, Modula-2, Oberon-2, VBA.

Databases: FoxPro, MS-Access, SQL-Server, Oracle.

Hobbies: Astronomy, space, science fiction, travel, nature.

Comments and Discussions