Click here to Skip to main content
15,895,799 members
Articles / Programming Languages / C#

Moveable Resizable Objects

Rate me:
Please Sign up or sign in to vote.
4.98/5 (59 votes)
9 Oct 2009CPOL198 min read 125.8K   8.7K   178  
Here is a description of an extremely powerful mechanism that makes screen objects moveable and resizable.
namespace Test_MoveGraphLibrary
{
    partial class Form_PersonalInfo_LTP
    {
        /// <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 .components = new System .ComponentModel .Container ();
            this .textZipCode = new System .Windows .Forms .TextBox ();
            this .textStreet = new System .Windows .Forms .TextBox ();
            this .textTown = new System .Windows .Forms .TextBox ();
            this .textProvince = new System .Windows .Forms .TextBox ();
            this .textCountry = new System .Windows .Forms .TextBox ();
            this .textMobilePhone = new System .Windows .Forms .TextBox ();
            this .textOfficePhone = new System .Windows .Forms .TextBox ();
            this .textHomePhone = new System .Windows .Forms .TextBox ();
            this .textProfession = new System .Windows .Forms .TextBox ();
            this .textYear = new System .Windows .Forms .TextBox ();
            this .textMonth = new System .Windows .Forms .TextBox ();
            this .textDay = new System .Windows .Forms .TextBox ();
            this .textSurname = new System .Windows .Forms .TextBox ();
            this .textName = new System .Windows .Forms .TextBox ();
            this .menuOnEmpty = new System .Windows .Forms .ContextMenuStrip (this .components);
            this .miNameView = new System .Windows .Forms .ToolStripMenuItem ();
            this .toolStripSeparator1 = new System .Windows .Forms .ToolStripSeparator ();
            this .miDefaultView = new System .Windows .Forms .ToolStripMenuItem ();
            this .menuOnEmpty .SuspendLayout ();
            this .SuspendLayout ();
            // 
            // textZipCode
            // 
            this .textZipCode .Location = new System .Drawing .Point (90, 379);
            this .textZipCode .MaximumSize = new System .Drawing .Size (200, 22);
            this .textZipCode .MinimumSize = new System .Drawing .Size (60, 22);
            this .textZipCode .Name = "textZipCode";
            this .textZipCode .Size = new System .Drawing .Size (90, 22);
            this .textZipCode .TabIndex = 27;
            // 
            // textStreet
            // 
            this .textStreet .Location = new System .Drawing .Point (90, 267);
            this .textStreet .MaximumSize = new System .Drawing .Size (600, 22);
            this .textStreet .MinimumSize = new System .Drawing .Size (100, 22);
            this .textStreet .Name = "textStreet";
            this .textStreet .Size = new System .Drawing .Size (152, 22);
            this .textStreet .TabIndex = 26;
            // 
            // textTown
            // 
            this .textTown .Location = new System .Drawing .Point (90, 295);
            this .textTown .MaximumSize = new System .Drawing .Size (300, 22);
            this .textTown .MinimumSize = new System .Drawing .Size (100, 22);
            this .textTown .Name = "textTown";
            this .textTown .Size = new System .Drawing .Size (152, 22);
            this .textTown .TabIndex = 25;
            // 
            // textProvince
            // 
            this .textProvince .Location = new System .Drawing .Point (90, 323);
            this .textProvince .MaximumSize = new System .Drawing .Size (300, 22);
            this .textProvince .MinimumSize = new System .Drawing .Size (100, 22);
            this .textProvince .Name = "textProvince";
            this .textProvince .Size = new System .Drawing .Size (152, 22);
            this .textProvince .TabIndex = 24;
            // 
            // textCountry
            // 
            this .textCountry .Location = new System .Drawing .Point (90, 351);
            this .textCountry .MaximumSize = new System .Drawing .Size (300, 22);
            this .textCountry .MinimumSize = new System .Drawing .Size (100, 22);
            this .textCountry .Name = "textCountry";
            this .textCountry .Size = new System .Drawing .Size (152, 22);
            this .textCountry .TabIndex = 23;
            // 
            // textMobilePhone
            // 
            this .textMobilePhone .Location = new System .Drawing .Point (406, 213);
            this .textMobilePhone .MaximumSize = new System .Drawing .Size (200, 22);
            this .textMobilePhone .MinimumSize = new System .Drawing .Size (100, 22);
            this .textMobilePhone .Name = "textMobilePhone";
            this .textMobilePhone .Size = new System .Drawing .Size (152, 22);
            this .textMobilePhone .TabIndex = 22;
            // 
            // textOfficePhone
            // 
            this .textOfficePhone .Location = new System .Drawing .Point (248, 213);
            this .textOfficePhone .MaximumSize = new System .Drawing .Size (200, 22);
            this .textOfficePhone .MinimumSize = new System .Drawing .Size (100, 22);
            this .textOfficePhone .Name = "textOfficePhone";
            this .textOfficePhone .Size = new System .Drawing .Size (152, 22);
            this .textOfficePhone .TabIndex = 21;
            // 
            // textHomePhone
            // 
            this .textHomePhone .Location = new System .Drawing .Point (90, 213);
            this .textHomePhone .MaximumSize = new System .Drawing .Size (200, 22);
            this .textHomePhone .MinimumSize = new System .Drawing .Size (100, 22);
            this .textHomePhone .Name = "textHomePhone";
            this .textHomePhone .Size = new System .Drawing .Size (152, 22);
            this .textHomePhone .TabIndex = 20;
            // 
            // textProfession
            // 
            this .textProfession .Location = new System .Drawing .Point (90, 160);
            this .textProfession .MaximumSize = new System .Drawing .Size (500, 22);
            this .textProfession .MinimumSize = new System .Drawing .Size (70, 22);
            this .textProfession .Name = "textProfession";
            this .textProfession .Size = new System .Drawing .Size (300, 22);
            this .textProfession .TabIndex = 19;
            // 
            // textYear
            // 
            this .textYear .Location = new System .Drawing .Point (188, 109);
            this .textYear .Name = "textYear";
            this .textYear .Size = new System .Drawing .Size (43, 22);
            this .textYear .TabIndex = 18;
            // 
            // textMonth
            // 
            this .textMonth .Location = new System .Drawing .Point (90, 109);
            this .textMonth .Name = "textMonth";
            this .textMonth .Size = new System .Drawing .Size (43, 22);
            this .textMonth .TabIndex = 17;
            // 
            // textDay
            // 
            this .textDay .Location = new System .Drawing .Point (139, 109);
            this .textDay .Name = "textDay";
            this .textDay .Size = new System .Drawing .Size (43, 22);
            this .textDay .TabIndex = 16;
            // 
            // textSurname
            // 
            this .textSurname .Location = new System .Drawing .Point (90, 58);
            this .textSurname .MaximumSize = new System .Drawing .Size (200, 22);
            this .textSurname .MinimumSize = new System .Drawing .Size (70, 22);
            this .textSurname .Name = "textSurname";
            this .textSurname .Size = new System .Drawing .Size (96, 22);
            this .textSurname .TabIndex = 15;
            // 
            // textName
            // 
            this .textName .Location = new System .Drawing .Point (90, 30);
            this .textName .MaximumSize = new System .Drawing .Size (200, 22);
            this .textName .MinimumSize = new System .Drawing .Size (70, 22);
            this .textName .Name = "textName";
            this .textName .Size = new System .Drawing .Size (96, 22);
            this .textName .TabIndex = 14;
            // 
            // menuOnEmpty
            // 
            this .menuOnEmpty .Items .AddRange (new System .Windows .Forms .ToolStripItem [] {
            this.miNameView,
            this.toolStripSeparator1,
            this.miDefaultView});
            this .menuOnEmpty .Name = "menuOnEmpty";
            this .menuOnEmpty .ShowImageMargin = false;
            this .menuOnEmpty .Size = new System .Drawing .Size (181, 54);
            this .menuOnEmpty .Opening += new System .ComponentModel .CancelEventHandler (this .OnOpening_menuOnEmpty);
            // 
            // miNameView
            // 
            this .miNameView .Name = "miNameView";
            this .miNameView .Size = new System .Drawing .Size (180, 22);
            this .miNameView .Text = "Name this view...";
            this .miNameView .Click += new System .EventHandler (this .Click_miNameView);
            // 
            // toolStripSeparator1
            // 
            this .toolStripSeparator1 .Name = "toolStripSeparator1";
            this .toolStripSeparator1 .Size = new System .Drawing .Size (177, 6);
            // 
            // miDefaultView
            // 
            this .miDefaultView .Name = "miDefaultView";
            this .miDefaultView .Size = new System .Drawing .Size (180, 22);
            this .miDefaultView .Text = "Default view";
            this .miDefaultView .Click += new System .EventHandler (this .Click_miSetDefaultView);
            // 
            // Form_PersonalInfo_LTP
            // 
            this .AutoScaleDimensions = new System .Drawing .SizeF (8F, 16F);
            this .AutoScaleMode = System .Windows .Forms .AutoScaleMode .Font;
            this .ClientSize = new System .Drawing .Size (592, 443);
            this .Controls .Add (this .textStreet);
            this .Controls .Add (this .textZipCode);
            this .Controls .Add (this .textTown);
            this .Controls .Add (this .textProvince);
            this .Controls .Add (this .textMobilePhone);
            this .Controls .Add (this .textOfficePhone);
            this .Controls .Add (this .textCountry);
            this .Controls .Add (this .textHomePhone);
            this .Controls .Add (this .textProfession);
            this .Controls .Add (this .textYear);
            this .Controls .Add (this .textSurname);
            this .Controls .Add (this .textMonth);
            this .Controls .Add (this .textName);
            this .Controls .Add (this .textDay);
            this .DoubleBuffered = true;
            this .MaximizeBox = false;
            this .MinimizeBox = false;
            this .Name = "Form_PersonalInfo_LTP";
            this .ShowIcon = false;
            this .Text = "Personal information (on CommentedControlLTP objects)";
            this .MouseUp += new System .Windows .Forms .MouseEventHandler (this .OnMouseUp);
            this .Paint += new System .Windows .Forms .PaintEventHandler (this .OnPaint);
            this .ContextMenuStripChanged += new System .EventHandler (this .OnContextMenuChanged);
            this .MouseDown += new System .Windows .Forms .MouseEventHandler (this .OnMouseDown);
            this .FormClosing += new System .Windows .Forms .FormClosingEventHandler (this .OnFormClosing);
            this .MouseMove += new System .Windows .Forms .MouseEventHandler (this .OnMouseMove);
            this .menuOnEmpty .ResumeLayout (false);
            this .ResumeLayout (false);
            this .PerformLayout ();

        }

        #endregion

        private System .Windows .Forms .TextBox textZipCode;
        private System .Windows .Forms .TextBox textStreet;
        private System .Windows .Forms .TextBox textTown;
        private System .Windows .Forms .TextBox textProvince;
        private System .Windows .Forms .TextBox textCountry;
        private System .Windows .Forms .TextBox textMobilePhone;
        private System .Windows .Forms .TextBox textOfficePhone;
        private System .Windows .Forms .TextBox textHomePhone;
        private System .Windows .Forms .TextBox textProfession;
        private System .Windows .Forms .TextBox textYear;
        private System .Windows .Forms .TextBox textMonth;
        private System .Windows .Forms .TextBox textDay;
        private System .Windows .Forms .TextBox textSurname;
        private System .Windows .Forms .TextBox textName;
        private System .Windows .Forms .ContextMenuStrip menuOnEmpty;
        private System .Windows .Forms .ToolStripMenuItem miNameView;
        private System .Windows .Forms .ToolStripSeparator toolStripSeparator1;
        private System .Windows .Forms .ToolStripMenuItem miDefaultView;
    }
}

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
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions