Click here to Skip to main content
15,885,757 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.2K   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_HouseParams
    {
        /// <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 .toolTip1 = new System .Windows .Forms .ToolTip (this .components);
            this .btnNumberFont = new System .Windows .Forms .Button ();
            this .btnNumberColor = new System .Windows .Forms .Button ();
            this .buttonWindow = new System .Windows .Forms .Button ();
            this .buttonDoor = new System .Windows .Forms .Button ();
            this .buttonHouse = new System .Windows .Forms .Button ();
            this .buttonRoof = new System .Windows .Forms .Button ();
            this .SuspendLayout ();
            // 
            // btnNumberFont
            // 
            this .btnNumberFont .Font = new System .Drawing .Font ("Microsoft Sans Serif", 7.8F, System .Drawing .FontStyle .Regular, System .Drawing .GraphicsUnit .Point, ((byte) (204)));
            this .btnNumberFont .Image = global::Test_MoveGraphLibrary .Properties .Resources .Font;
            this .btnNumberFont .Location = new System .Drawing .Point (209, 71);
            this .btnNumberFont .Name = "btnNumberFont";
            this .btnNumberFont .Size = new System .Drawing .Size (28, 28);
            this .btnNumberFont .TabIndex = 11;
            this .toolTip1 .SetToolTip (this .btnNumberFont, "Number\'s font");
            this .btnNumberFont .UseVisualStyleBackColor = true;
            this .btnNumberFont .Click += new System .EventHandler (this .Click_btnNumberFont);
            // 
            // btnNumberColor
            // 
            this .btnNumberColor .Image = global::Test_MoveGraphLibrary .Properties .Resources .palette_;
            this .btnNumberColor .Location = new System .Drawing .Point (175, 71);
            this .btnNumberColor .Name = "btnNumberColor";
            this .btnNumberColor .Size = new System .Drawing .Size (28, 28);
            this .btnNumberColor .TabIndex = 10;
            this .toolTip1 .SetToolTip (this .btnNumberColor, "Number\'s color");
            this .btnNumberColor .UseVisualStyleBackColor = true;
            this .btnNumberColor .Click += new System .EventHandler (this .Click_btnNumberColor);
            // 
            // buttonWindow
            // 
            this .buttonWindow .Image = global::Test_MoveGraphLibrary .Properties .Resources .palette_;
            this .buttonWindow .Location = new System .Drawing .Point (233, 172);
            this .buttonWindow .Name = "buttonWindow";
            this .buttonWindow .Size = new System .Drawing .Size (28, 28);
            this .buttonWindow .TabIndex = 9;
            this .toolTip1 .SetToolTip (this .buttonWindow, "Window color");
            this .buttonWindow .UseVisualStyleBackColor = true;
            this .buttonWindow .Click += new System .EventHandler (this .Click_btnWindow);
            // 
            // buttonDoor
            // 
            this .buttonDoor .Image = global::Test_MoveGraphLibrary .Properties .Resources .palette_;
            this .buttonDoor .Location = new System .Drawing .Point (109, 271);
            this .buttonDoor .Name = "buttonDoor";
            this .buttonDoor .Size = new System .Drawing .Size (28, 28);
            this .buttonDoor .TabIndex = 8;
            this .toolTip1 .SetToolTip (this .buttonDoor, "Door color");
            this .buttonDoor .UseVisualStyleBackColor = true;
            this .buttonDoor .Click += new System .EventHandler (this .Click_btnDoor);
            // 
            // buttonHouse
            // 
            this .buttonHouse .Image = global::Test_MoveGraphLibrary .Properties .Resources .palette_;
            this .buttonHouse .Location = new System .Drawing .Point (68, 117);
            this .buttonHouse .Name = "buttonHouse";
            this .buttonHouse .Size = new System .Drawing .Size (28, 28);
            this .buttonHouse .TabIndex = 7;
            this .toolTip1 .SetToolTip (this .buttonHouse, "House color");
            this .buttonHouse .UseVisualStyleBackColor = true;
            this .buttonHouse .Click += new System .EventHandler (this .Click_btnHouse);
            // 
            // buttonRoof
            // 
            this .buttonRoof .Image = global::Test_MoveGraphLibrary .Properties .Resources .palette_;
            this .buttonRoof .Location = new System .Drawing .Point (157, 12);
            this .buttonRoof .Name = "buttonRoof";
            this .buttonRoof .Size = new System .Drawing .Size (28, 28);
            this .buttonRoof .TabIndex = 6;
            this .toolTip1 .SetToolTip (this .buttonRoof, "Roof color");
            this .buttonRoof .UseVisualStyleBackColor = true;
            this .buttonRoof .Click += new System .EventHandler (this .Click_btnRoof);
            // 
            // Form_HouseParams
            // 
            this .AutoScaleDimensions = new System .Drawing .SizeF (8F, 16F);
            this .AutoScaleMode = System .Windows .Forms .AutoScaleMode .Font;
            this .ClientSize = new System .Drawing .Size (352, 320);
            this .Controls .Add (this .btnNumberFont);
            this .Controls .Add (this .btnNumberColor);
            this .Controls .Add (this .buttonWindow);
            this .Controls .Add (this .buttonDoor);
            this .Controls .Add (this .buttonHouse);
            this .Controls .Add (this .buttonRoof);
            this .DoubleBuffered = true;
            this .MaximizeBox = false;
            this .MinimizeBox = false;
            this .Name = "Form_HouseParams";
            this .Text = "Colors and font";
            this .Paint += new System .Windows .Forms .PaintEventHandler (this .OnPaint);
            this .ResumeLayout (false);

        }

        #endregion

        private System .Windows .Forms .Button btnNumberFont;
        private System .Windows .Forms .Button btnNumberColor;
        private System .Windows .Forms .Button buttonWindow;
        private System .Windows .Forms .Button buttonDoor;
        private System .Windows .Forms .Button buttonHouse;
        private System .Windows .Forms .Button buttonRoof;
        private System .Windows .Forms .ToolTip toolTip1;
    }
}

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